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
Install-WindowsFeature –Name GPMC |
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
$Source = "" | |
$Destination = "" | |
Get-ADUser -Identity $Source -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members $Destination |
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
# Get Auditing Status | |
Get-OrganizationConfig | Select AuditDisabled | |
# Disable Auditing for Tenant | |
Set-OrganizationConfig -AuditDisabled $True | |
# Disable Auditing for User | |
Set-MailboxAuditBypassAssociation -Identity $User -AuditBypassEnabled $True | |
# Find Mailboxes with Audting Disabled |
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
Get-Mailbox -Filter {AuditEnabled -eq $False} -RecipientTypeDetails UserMailbox, SharedMailbox | Set-Mailbox -AuditEnabled $True –AuditDelegate Create, FolderBind, SendAs, SendOnBehalf, SoftDelete, HardDelete, Update, Move, MoveToDeletedItems, UpdateFolderPermissions |
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
$Server = "" | |
(Get-Counter -Counter "\Memory\Available MBytes" -ComputerName $Server).CounterSamples[0].CookedValue |
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
$Credential = New-Object System.Management.Automation.PSCredential 'username',(convertto-securestring 'password' -asplaintext -force) |
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
logoff /server:remote_computer_name |
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
$AccountName = "" | |
Set-AdAccountPassword -Identity $AccountName -OldPassword (Read-Host -asSecureString "Current password") -NewPassword (Read-Host -asSecureString "New password") |
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
Function Invoke-RemoteVolumeExpand | |
{ | |
Param | |
( | |
$Server | |
) | |
Function Invoke-VolumeExpand | |
{ | |
$Include = "C|W|D|E|F" | |
$Partitions = Get-Partition | Where-Object {$_.DriveLetter -Match $Include} |
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
Function Set-SQLLogFileSizeAndGrowth | |
{ | |
Param | |
( | |
$Instance | |
) | |
Import-Module dbatools -ErrorAction SilentlyContinue | |
If ((Get-Module | Where-Object {$_.Name -eq "dbatools"}) -eq $null) | |
{ | |
Write-Output "Installing required module: $dbatools" |