Support Forums

Search found 10616 matches

by jvierra
Mon Apr 17, 2017 12:34 pm
Forum: PowerShell GUIs
Topic: How to maintain checkbox state when filtering checkedlistbox items?
Replies: 12
Views: 134

Re: How to maintain checkbox state when filtering checkedlistbox items?

You have to bind to a datatable and set the RowFilter on the datasource.Dataview. This is the only way the checks will be remembered.
by jvierra
Mon Apr 17, 2017 8:23 am
Forum: PowerShell GUIs
Topic: How to maintain checkbox state when filtering checkedlistbox items?
Replies: 12
Views: 134

Re: How to maintain checkbox state when filtering checkedlistbox items?

I am sorry but I don't have an example of this that is useful for you.

Just use a DataGridView and load the services using the "ConvertTo-DataTable function. Add on extra column that is a boolean which will provide the checkbox.
by jvierra
Sun Apr 16, 2017 2:59 am
Forum: PowerShell GUIs
Topic: Setting AD Password from GUI
Replies: 3
Views: 141

Re: Setting AD Password from GUI

Add-Type -AssemblyName System.Web $richtextbox1.text = [System.Web.Security.Membership]::GeneratePassword(8, 1) $password = $richtextbox1.Text | ConvertTo-SecureString -AsPlainText -Force Set-ADAccountPassword $username.Text -NewPassword $password -Reset Set-ADuser $username.Text -ChangePas...
by jvierra
Sat Apr 15, 2017 10:38 am
Forum: Windows PowerShell
Topic: How to have PowerShell to not truncate in the table for logon hours?
Replies: 3
Views: 152

Re: How to have PowerShell to not truncate in the table for logon hours?

That is because it is an array and not a string.


Get-Aduser -Identity $name -Property * -Server $DC1 | Select -expand logonhours
by jvierra
Sat Apr 15, 2017 6:04 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

Consider this: $ix = $listview2.Columns.Add((New-Object System.Windows.Forms.ColumnHeader)) $listview2.Columns[$ix].name = 'Hostname' $listview2.Columns[$ix].Text = 'Hostname' $listview2.Columns[$ix].Width = 150 $listview2.Columns[$ix].TextAlign = 'Center' "AutoComplete" in PowerShell will...
by jvierra
Sat Apr 15, 2017 5:50 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

Here is a much easier way to generate columns. $ix = $listview2.Columns.Add((New-Object System.Windows.Forms.ColumnHeader)) $listview2.Columns[$ix].name = 'Hostname' $listview2.Columns[$ix].Text = 'Hostname' $listview2.Columns[$ix].Width = 150 $ix = $listview2.Columns...
by jvierra
Sat Apr 15, 2017 5:33 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

This is the one that works the way you want: Get-ADComputer -Filter * -SearchBase 'OU=DOMUSERS,DC=DOM,DC=LOCAL' | ForEach-Object { $item1 = New-Object System.Windows.Forms.ListViewItem $item1.Text = $_.Name $item1.Name = $_.Name $item1.SubItems.Add('') $item1.SubItems.Add(...
by jvierra
Sat Apr 15, 2017 5:04 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

Post the code you actually used.
by jvierra
Sat Apr 15, 2017 4:49 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

Without seeing the code that did this I cannot comment.
by jvierra
Sat Apr 15, 2017 4:16 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 151

Re: Listview check Service status and change icon

You can't add images to a list before you have crated them. You can add them with a keyname and use ImageKey to reference the image.

Go to advanced search