Reply To: Using DSC Pull server to configure a new pull server
Whoops, ok I reread the section from the DSC Book, and see that there is no 'v' in the version. I renamed xPSDesiredStateConfiguration_v3.0.0.0.zip to xPSDesiredStateConfiguration_3.0.0.0.zip, reran...
View ArticleReply To: Get-ADUser -Filter string array
Since you're querying Active Directory to return a list of users based on exact matches of what's in each element in the array, you can simply pipe the array to Get-ADUser. This will use the Identity...
View ArticleNew-Object Saved as a $variable
Here is my script: Invoke-Command -Session $s -ScriptBlock { $Result = Get-Hotfix | where {$_.hotfixid -eq 'KB2617858'} if ($Result) { New-Object PSObject -Property @{Computer = hostname; Installed =...
View ArticleReply To: New-Object Saved as a $variable
H Man, Are you looking for something like this? $Hotfix = 'KB976002' $Session = New-PSSession -ComputerName localhost $Results = Invoke-Command -Session $Session -ScriptBlock { $Result = Get-Hotfix...
View ArticleReply To: New-Object Saved as a $variable
not working! the session i have opened has about 60 computers. when i run your code i get an error This command cannot find hot-fix on the machine 'localhost'. Verify the input and Run your command...
View ArticleReply To: New-Object Saved as a $variable
I've added the ErrorAction parameter to the Get-Hotfix line which will suppress the error message. $Hotfix = 'KB976002' $Results = Invoke-Command -Session $s -ScriptBlock { $Result = Get-Hotfix -Id...
View ArticleReply To: New-Object Saved as a $variable
$s = New-PSSession -ComputerName (gc c:\computers.txt) $Hotfix = 'KB976002' $Results = Invoke-Command -Session $S -ScriptBlock { $Result = Get-Hotfix -Id $Using:Hotfix New-Object -TypeName psobject...
View ArticleReply To: New-Object Saved as a $variable
$Result = Get-Hotfix | where {$_.hotfixid -eq 'KB2617858'} if ($Result) { New-Object PSObject -Property @{Computer = hostname; Installed = $true } } else { New-Object PSObject -Property @{Computer =...
View ArticleReply To: New-Object Saved as a $variable
after the 2nd new-object out-side the icm sricpt block i have been | to export-csv
View ArticleReply To: New-Object Saved as a $variable
Do you want this object to be in a variable in the remote session (inside the script block that's running with Invoke-Command), or back on your local computer? For the former, assign the result from...
View ArticleReply To: New-Object Saved as a $variable
thanks Dave ! $variable = Invoke-Command (etc) worked like a charm
View ArticleUsing Install-WindowsFeature from a form
I'm creating a form wrapper around a set of cmdlets. One of those cmdlets is Install-WindowsFeature. I'm trying to install the AS-NET-Framework, WDS and UpdateServices roles. I've confirmed both the...
View ArticleReply To: Using Install-WindowsFeature from a form
You don't mention what OS you're using, but keep in mind that the ServerManager cmdlets in 2012+ use a certain amount of Remoting under the hood to do their job. That could be causing the hangup,...
View ArticleReply To: Using Install-WindowsFeature from a form
Thanks, Don. I'm using 2012 R2 and, as always, every time I post a question on a forum I figure out how to do it. Sorry about that. I completely understand about the not using a GUI argument. I don't....
View ArticleReply To: Using Install-WindowsFeature from a form
That was going to be my suggestion for getting it out of the WinForms context – either that, or launching the command in a job, which you can then check the status of. The WinForms stuff is a little...
View ArticleReply To: Using Install-WindowsFeature from a form
Hmm..a job would be a cleaner way to do it. I'll look into that.
View ArticleToShortTimeString() vs .Converttodatetime( )
Hi All I am doing a wmi query (Get-WmiObject -Class Win32_OperatingSystem) and im looking to format the LastBootUpTime Select-Object CSName,@{ Name = "Last Restarted On" ; Expression = {...
View ArticleReply To: ToShortTimeString() vs .Converttodatetime( )
Ill be using this rt do some conditional html formatting [xml]$html = $Reboot | ConvertTo-Html -fragment #check each row, skipping the TH header row for ($i=1;$i -le $html.table.tr.count-1;$i++) {...
View Article