Search found 15246 matches

by jvierra
Wed Aug 10, 2022 2:21 am
Forum: PowerShell GUIs
Topic: combobox and valuemember
Replies: 3
Views: 103

Re: combobox and valuemember

You are absolutely wrong about having to create a table object. The SQL query returns a datatable and the CB is designed to work with DataTable objects. Hash tables are not really usable with controls as a datasource. The Update-ComboBox CmdLet internally turns a hash into a DataTable. You cannot ge...
by jvierra
Tue Aug 09, 2022 8:06 pm
Forum: PowerShell GUIs
Topic: combobox and valuemember
Replies: 3
Views: 103

Re: combobox and valuemember

"ValueMember" takes a string constant that names the member you want to be set in the "Value" property of the ComboBox. You cannot gather this string by enumerating a collection. A ComboBox should be loaded by just adding the array to the CB. An easier method is to just assign th...
by jvierra
Mon Aug 08, 2022 6:36 am
Forum: PowerShell GUIs
Topic: Form: disable button while scheduled task is running
Replies: 2
Views: 73

Re: Form: disable button while scheduled task is running

The following links will explain how to use button controls. https://info.sapien.com/index.php/guis/gui-controls/spotlight-on-the-button-control https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.button?redirectedfrom=MSDN&view=windowsdesktop-6.0 Right clicking on any control in th...
by jvierra
Sun Aug 07, 2022 7:37 pm
Forum: PowerShell GUIs
Topic: TreeView with dynamically populating child nodes with children (Active Directory related)
Replies: 3
Views: 106

Re: TreeView with dynamically populating child nodes with children (Active Directory related)

Here is an example of how to use a Treeview with images. It also is a good sampler of other TreeView options.
by jvierra
Sat Aug 06, 2022 4:23 pm
Forum: PowerShell GUIs
Topic: TreeView with dynamically populating child nodes with children (Active Directory related)
Replies: 3
Views: 106

Re: TreeView with dynamically populating child nodes with children (Active Directory related)

The attached is the best, fastest and easiest way to load a TreeView from AD and generate the hierarchy. Notice it uses almost no code and uses the hierarchy of AD and the hierarchy of the TV to work synchronously to create the tree.

This form should work without changes on any AD client computer.
by jvierra
Fri Aug 05, 2022 2:35 pm
Forum: PowerShell GUIs
Topic: First progress bar for export ad users
Replies: 1
Views: 82

Re: First progress bar for export ad users

What you are trying to do cannot be done as Get-AdUser is a blocking call. Once event code is blocked then you cannot execute any other code until the bocking ends. Enumerating the result will happen so fast you will not see the pbar increment. It is also better to increment the value as the method ...
by jvierra
Fri Aug 05, 2022 1:41 am
Forum: PowerShell
Topic: need help
Replies: 1
Views: 147

Re: need help

If the command doesn't execute correctly, it will throw an exception. You will have to catch the exception and decide which message you want to display. Start by reviewing the documentation on exception handling in PowerShell. Also review the AD command for how it generates exceptions. Start with he...
by jvierra
Mon Aug 01, 2022 9:35 am
Forum: PowerShell
Topic: Script for Disabled users in AD
Replies: 3
Views: 337

Re: Script for Disabled users in AD

IT for 10 years. You likely haven't been asked to write code before. I cannot give you what you ask for as you are asking for someone to design a solution for you. Forums are not good places to ask for design assistance. Forums are useful when you have a specific question about code you have written...
by jvierra
Mon Aug 01, 2022 9:15 am
Forum: PowerShell GUIs
Topic: Jobtracker - GUI - updating datagridview
Replies: 6
Views: 383

Re: Jobtracker - GUI - updating datagridview

Please take the time to review the documentation for the commands. CIM can use DCOM which is fundamentally the same as WMI uses. See the docs to learn how to use CIM. There are explicit examples. Example 7 - https://docs.microsoft.com/en-us/powershell/module/CimCmdlets/New-CimSession?view=powershell...
by jvierra
Mon Aug 01, 2022 2:59 am
Forum: PowerShell GUIs
Topic: Jobtracker - GUI - updating datagridview
Replies: 6
Views: 383

Re: Jobtracker - GUI - updating datagridview

You are also mixing up scheduled jobs with scheduled tasks. PowerShell scheduled tasks use WMI/CIM and do not require remoting to be enabled. You also really do not need a job for this. You can loop through a dozen remote systems with "Get-ScheduledTaskInfo" and bind the results to a DGV.