Import-Module ActiveDirectory
$Groups = Get-ADComputer -Filter * | Select -Expand Name
Foreach($G In $Groups)
{
WMIC /node:$G process create call “net time /’ntpaddress’ /set”
}
net time /’ntpaddress’/set
Import-Module ActiveDirectory
$Groups = Get-ADComputer -Filter * | Select -Expand Name
Foreach($G In $Groups)
{
WMIC /node:$G process create call “net time /’ntpaddress’ /set”
}
net time /’ntpaddress’/set
$dir1 = Read-Host
$dir2 = Read-Host
Clear-Host
Get-ChildItem -path $dir1 | Format-Table Name
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
takes a bit to install
‘brew cask install powershell’
to upgrade
brew update
brew cask upgrade powershell
Import-Module ActiveDirectory
$Groups = Get-ADGroup -Properties * -Filter * -SearchBase “DC=,DC=”
Foreach($G In $Groups)
{
$G.Name
“————-”
$G.Members
}
#Select last 15 minutes
$start=(Get-Date).AddMinutes(-15)
$end=Get-Date
#email recipients as an array
[string[]]$recipients = “
#when testing and not spamming
#$recipients = “
$emailbody=Get-Eventlog -log application -after $start -before $end -Source “SOURCE” | where {$_.eventID -eq 123 -or $_.eventID -eq 456} | select EventID,TimeGenerated,Message | ConvertTo-HTML
#convert to string for email purposes
$stringbody=Out-String -InputObject $emailbody
#send email
Send-MailMessage -To $recipients -From “User” -Cc “
Set as a scheduled task run every 15 minutes, -ExecutionPolicy Bypass
https://support.office.com/en-us/article/search-for-and-delete-email-messages-in-your-office-365-organization-admin-help-3526fd06-b45f-445b-aed4-5ebd37b3762a
http://help.outlook.com/en-ca/140/gg315525.aspx
This pulls a lot of info I was writing powercli scripts for
https://www.robware.net/rvtools/
$DaysInactive = 90
$time = (Get-Date).Adddays(-($DaysInactive))
Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name, OperatingSystem
Get-ADComputer -Filter {OperatingSystem -Like “Windows *Server*”} -Property Name | ForEach-Object {
$name = $_.name
$drives = wmic /node:$name logicaldisk where drivetype=3 get caption,volumename
$name = “`n” + $name
write-host $name $drives
}
Convert background to transparent
Illustrator >> View >> Show transparency grid
Scale Tool
1. Click the “Selection” tool, or arrow, from the Tools panel and click to select the object you want to resize.
2. Choose the “Scale” tool from Tools panel.
3. Click anywhere on the stage and drag up to increase the height; drag across to increase the width. Hold the “Shift” key before you begin the drag to scale proportionately.
4. Double-click the “Scale” tool to resize the selected image using specific value percentages. Enter the values in the applicable fields. For instance, type “50” in the Scale field of the Uniform section to resize the image to 50 percent.