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
<############################# | |
## 2015-07-10, 14:45 - | |
## Check if Session running with evevated / administrator privledges | |
#############################> | |
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
#Ref: http://www.jonathanmedd.net/2014/01/testing-for-admin-privileges-in-powershell.html | |
<############################# | |
## 2015-07-10, 11:10 - |
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
############ | |
## DAILY CHECKS | |
############ | |
# 00. Initial Setup | |
<# | |
Set-Location \\WIN8\ISB\ | |
mkdir Logs | |
Get-ADComputer -Filter * | select Name | Out-File \\WIN8\ISB\Lists\AllComputers.txt |
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
Function Get-ADGuidLen{ | |
begin{} | |
Process{ | |
foreach ($user in (Get-ADUser -Filter *)) | |
{ | |
$props = @{"User"=$user.DistinguishedName; | |
"GuidLength"=$user.ObjectGUID.ToString().Length;} | |
$obj = New-Object -TypeName psobject -Property $props | |
Write-Output $obj | |
} |