Last active
June 20, 2017 15:21
-
-
Save PrateekKumarSingh/5e3a9a4b59b1580d1a1170fadacaf751 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$domain= 'LABDOMAIN\Username' | |
$pass=ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force | |
$creds=New-Object System.Management.Automation.pscredential -ArgumentList $domain, $pass | |
(Get-Content D:\Servers.txt| ` | |
Foreach{Invoke-Command -ComputerName $_ -Verbose -ScriptBlock{get-windowsfeature | ` | |
Where-Object{$_.installed -eq $true -and $_.featuretype -eq 'Role'} | | |
select name, installed -ExcludeProperty subfeatures} -Credential $creds}) | ` | |
Format-Table -Property Name, Installed, @{name='Server Name';expression={$_.pscomputername}} -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment