Get-WmiObject-ClassName Win32_UserProfile -Filter"Special=False AND Loaded=False" | Add-Member-MemberType ScriptProperty -Name UserName -Value { (New-Object System.Security.Principal.SecurityIdentifier($this.Sid)).Translate([System.Security.Principal.NTAccount]).Value } -PassThru | Out-GridView-Title"Select User Profile"-OutputMode Single | ForEach-Object { # uncomment the line below to actually remove the selected user profile! #$_.Delete() }
$hashTable.Keys | Sort-Object | Out-GridView-Title"Select User Profile"-OutputMode Single | ForEach-Object { # uncomment the line below to actually remove the selected user profile! # $hashTable[$_].Delete()
Get-WmiObject-ClassName Win32_UserProfile -Filter"Special=False AND Loaded=False" | Add-Member-MemberType ScriptProperty -Name UserName -Value { (New-Object System.Security.Principal.SecurityIdentifier($this.Sid)).Translate([System.Security.Principal.NTAccount]).Value } -PassThru | Out-GridView-Title"Select User Profile"-OutputMode Single | ForEach-Object { # uncomment the line below to actually remove the selected user profile! #$_.Delete() }
Are you an experienced professional PowerShell user? Then learning from default course work isn’t your thing. Consider learning the tricks of the trade from one another! Meet the most creative and sophisticated fellow PowerShellers, along with Microsoft PowerShell team members and PowerShell inventor Jeffrey Snover. Attend this years’ PowerShell Conference EU, taking place April 17-20 in Hanover, Germany, for the leading edge. 35 international top speakers, 80 sessions, and security workshops are waiting for you, including two exciting evening events. The conference is limited to 300 delegates. More details at www.psconf.eu.
# configure the computer you directly connect to Invoke-Command-ScriptBlock { Enable-WSManCredSSP-Role Server -Force | Out-String } -ComputerName$TargetServer
# get results from all machines in parallel... $results = Invoke-Command-ScriptBlock$code-ComputerName$serverList | # and separate results by PSComputerName Group-Object-Property PSComputerName -AsHashTable-AsString