Search found 11056 matches

by jvierra
Tue Jul 25, 2017 5:37 am
Forum: VBScript
Topic: Change properties of Local Group; e.g. rename group, change description.
Replies: 6
Views: 80

Re: Change properties of Local Group; e.g. rename group, change description.

Code: Select all

Set oGroup = GetObject( "WinNT://alpha/TestGrp, group")
Set oComputer = GetObject( "WinNT://alpha")
Set oNewGroup = oComputer.MoveHere(oGroup.aDSPath, "NewTestGrp")
WScript.Echo oNewGroup.aDSPath
by jvierra
Tue Jul 25, 2017 5:34 am
Forum: VBScript
Topic: Change properties of Local Group; e.g. rename group, change description.
Replies: 6
Views: 80

Re: Change properties of Local Group; e.g. rename group, change description.

Sorry. With VBScript we need to use
Set Newobject = computer.MoveHere(object,"Newname")
by jvierra
Mon Jul 24, 2017 8:41 am
Forum: VBScript
Topic: Change properties of Local Group; e.g. rename group, change description.
Replies: 6
Views: 80

Re: Change properties of Local Group; e.g. rename group, change description.

This is how to rename a group:

'sGroup.Rename(“Gusto”)
by jvierra
Mon Jul 24, 2017 2:08 am
Forum: Windows PowerShell
Topic: Tsql error
Replies: 5
Views: 83

Re: Tsql error

I should also note that OleDB to SQLServer does not use that kind of connection string. Uwe the SQLClient instead.
by jvierra
Mon Jul 24, 2017 1:51 am
Forum: Windows PowerShell
Topic: Tsql error
Replies: 5
Views: 83

Re: Tsql error

You have come subtle syntax issues that can cause issues. The SQL does not return a table. It will return a number to indicate the results. Trying to load a table will return nothing in all tools. function ExecSQLCommand{ param ( $SqlQuery, $Server, $DataBase ) $connStr = "Provider=sqloledb;Integrat...
by jvierra
Fri Jul 21, 2017 8:33 am
Forum: PowerShell GUIs
Topic: Exporting ListView data to CSV
Replies: 3
Views: 103

Re: Exporting ListView data to CSV

$FormEvent_Load={ $files = Get-ChildItem c:\windows -File | select name, length, fullname $datagridview1.DataSource = ConvertTo-DataTable $files } $buttonExportCsv_Click = { $datagridview1.SelectedRows | Select-Object -expand DataBoundItem | Export-csv Results.csv -notype .\Results.csv }
by jvierra
Fri Jul 21, 2017 8:21 am
Forum: PowerShell GUIs
Topic: Exporting ListView data to CSV
Replies: 3
Views: 103

Re: Exporting ListView data to CSV

You cannot directly export from a ListView. Use a DataGridView to export to a CSV.
by jvierra
Fri Jul 21, 2017 6:58 am
Forum: Windows PowerShell
Topic: Scheduled task parameter
Replies: 15
Views: 200

Re: Scheduled task parameter

The VM name is in the DATA elements. That is how it gets displayed in the message. The source computer name for the event is in the "COMPUTER" element of the SYSTEM elements in the XML. That is hw the event system works SYSTEM <EventID Qualifiers="16384">6101</EventID> <Computer> myHyper-V.Node </Co...
by jvierra
Thu Jul 20, 2017 1:46 pm
Forum: Windows PowerShell
Topic: Scheduled task parameter
Replies: 15
Views: 200

Re: Scheduled task parameter

Also ntoe that this is where the sending computers name should be stored:

<Computer>myHyper-V.Node</Computer>

Which is here:

$xml.Events.Event[0].System.Computer
by jvierra
Thu Jul 20, 2017 1:44 pm
Forum: Windows PowerShell
Topic: Scheduled task parameter
Replies: 15
Views: 200

Re: Scheduled task parameter

Which is why I asked you to post the XML from the collection server. What you posted does not have correct information.

This will only work if the VM computer name and the VM name are identical which is not always the case. Events are not tracked by VM name.