# Define the Computer Name
$computerName = "dc1"
# Define the IPv4 Addressing
$IPv4Address = "10.10.100.25"
$IPv4Prefix = "24"
$IPv4GW = "10.10.100.1"
$IPv4DNS = "8.8.8.8"
This file contains hidden or 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
| Import-module servermanager ; Get-WindowsFeature | where-object {$_.Installed -eq $True} | format-list DisplayName |
This file contains hidden or 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
| PS C:\> net localgroup administrators | |
| Alias name administrators | |
| Comment Administrators have complete and unrestricted access to the computer/domain | |
| Members | |
| ------------------------------------------------------------------------------- | |
| Administrator | |
| GLOBOMANTICS\Domain Admins | |
| localadmin | |
| The command completed successfully. |
This file contains hidden or 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
| Import-module servermanager ; (Get-WindowsFeature -name hyper-v).Installed |
This file contains hidden or 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
| Const MSG_RECIPIENT_LIST = "[email protected]" | |
| Const MSG_SUBJECT = "Some Subject" | |
| Const MSG_BODY = "Testing" | |
| Dim olkApp, olkSes, olkMsg | |
| Set olkApp = CreateObject("Outlook.Application") | |
| Set olkSes = olkApp.GetNamespace("MAPI") | |
| olkSes.Logon olkApp.DefaultProfileName | |
| Set olkMsg = olkApp.CreateItem(0) | |
| With olkMsg |
This file contains hidden or 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
| Get-WmiObject –class Win32_processor | ft systemname,Name,DeviceID,NumberOfCores,NumberOfLogicalProcessors, Addresswidth |
This file contains hidden or 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
| PS C:\> Get-NetLocalGroup -Group "remote desktop users" -Computername $sessions | |
| Group : remote desktop users | |
| Computername : CHI-FP01 | |
| Members : | |
| Group : remote desktop users | |
| Computername : CHI-WIN8-01 | |
| Members : | |
| Computername : CHI-EX01 | |
| Members : | |
| Group : remote desktop users |
This file contains hidden or 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
| PS C:\> invoke-command {net localgroup administrators} -comp chi-fp01 | |
| Alias name administrators | |
| Comment Administrators have complete and unrestricted access to the computer/domain | |
| Members | |
| ------------------------------------------------------------------------------- | |
| Administrator | |
| GLOBOMANTICS\Chicago IT | |
| GLOBOMANTICS\Domain Admins | |
| The command completed successfully. |
This file contains hidden or 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
| PS C:\> invoke-command { | |
| >> net localgroup administrators | | |
| >> where {$_ -AND $_ -notmatch "command completed successfully"} | | |
| >> select -skip 4 | |
| >> } -computer chi-fp01 | |
| >> | |
| Administrator | |
| GLOBOMANTICS\Chicago IT | |
| GLOBOMANTICS\Domain Admins |
This file contains hidden or 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
| $members = net localgroup administrators | | |
| where {$_ -AND $_ -notmatch "command completed successfully"} | | |
| select -skip 4 | |
| New-Object PSObject -Property @{ | |
| Computername = $env:COMPUTERNAME | |
| Group = "Administrators" | |
| Members=$members | |
| } |