piszczynski>Aleks |
piszczynski>Aleks |
||
| Line 15: | Line 15: | ||
Get-ADUser -Filter * -SearchBase $OUpath | Select-object DistinguishedName,Name,UserPrincipalName,sAMAccountName | Export-Csv -NoType $ExportPath | Get-ADUser -Filter * -SearchBase $OUpath | Select-object DistinguishedName,Name,UserPrincipalName,sAMAccountName | Export-Csv -NoType $ExportPath | ||
</pre> | </pre> | ||
Script to ping IP address and log time and status of ping: | |||
https://github.com/AleksPish/NetworkPingTest/blob/master/NetworkDownTest.ps1 | |||
Revision as of 19:56, 27 May 2019
Handy Powershell
Output Command History to text file:
Get-History | ForEach-Object { $_.CommandLine } > $env.USERPROFILE\testoutput.txt
Export details of users in a specific OU:
$OUpath = '<place OU path here distinguished name of ou in attribute editor>' $ExportPath = '<place where to put output>' Get-ADUser -Filter * -SearchBase $OUpath | Select-object DistinguishedName,Name,UserPrincipalName,sAMAccountName | Export-Csv -NoType $ExportPath
Script to ping IP address and log time and status of ping: https://github.com/AleksPish/NetworkPingTest/blob/master/NetworkDownTest.ps1