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 Rename-PC{ | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$false)] | |
| [string]$OldPCName, | |
| [Parameter(Mandatory=$false)] | |
| [string]$NewPCName, | |
| ) | |
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 Add-MS365GroupOwners{ | |
| # Add Owners to Microsoft 365 Groups Without An Owner | |
| #Install-Module ExchangeOnlineManagement | |
| Import-Module ExchangeOnlineManagement | |
| # Check For Basic Auth So You Get The Full Command Set From EXO | |
| $String1 = "Basic = true" | |
| $Basic = winrm get winrm/config/client/auth | Select-String $String1 |
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
| <# | |
| .SYNOPSIS | |
| Parses the netlogon.log on DC's to find where there are client logins but no AD Sites and Services Subnet. | |
| .DESCRIPTION | |
| '# WIP' Means it is still a Work In Progress | |
| ################################################################## |
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
| # https://social.technet.microsoft.com/Forums/windows/en-US/fb7ceef5-0048-4e80-826e-730cb3744c48/powershell-counting-all-ad-departments?forum=ITCG | |
| # Get a Unique List of Departments from AD | |
| $Output = "C:\SCRIPTS\AD\Department\Department_Count.txt" | |
| if (!(Test-Path -Path $Output) ){ | |
| # Create a directory if it doesn't exist based on the $Output minus the file name | |
| New-Item (Split-Path -Path $Output -Parent) -ItemType Directory | |
| } |
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-IfImAdmin{ | |
| # Find out if the current user identity is elevated (has admin rights) | |
| $identity = [Security.Principal.WindowsIdentity]::GetCurrent() | |
| $identity | |
| $principal = New-Object Security.Principal.WindowsPrincipal $identity | |
| $principal | |
| $isAdmin = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) |
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-Desktops{ | |
| # Includes Disabled Desktops | |
| Get-ADComputer -Filter * -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 | | |
| Where-Object {($_.OperatingSystem -like "Windows*") -and ($_.OperatingSystem -notlike "Windows Server*")} | | |
| Select-Object Name,Enabled,OperatingSystem | Sort-Object Name | |
| } |
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-DesktopOS{ | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true)] | |
| [string]$ComputerName | |
| ) | |
| Get-ADComputer -Filter {Name -eq $ComputerName} -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 | |
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-DesktopsOS { | |
| "`r" | |
| $PCs = Get-ADComputer -Filter * -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 | | |
| Where-Object {($_.OperatingSystem -like "Windows*") -and ($_.OperatingSystem -notlike "Windows Server*")} | | |
| Select-Object Name,Enabled,OperatingSystem | Sort-Object Name | |
| $UniquePCs = ($PCs | Where {($_.Enabled -eq $true)}).OperatingSystem | Sort-Object | Get-Unique -AsString | |
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-Servers { | |
| # Includes Disabled Servers | |
| Get-ADComputer -Filter * -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 | | |
| Where-Object {$_.OperatingSystem -like "Windows Server*"} | Select-Object Name,Enabled,OperatingSystem | Sort-Object Name | |
| } |
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-NonWindowsOS { | |
| # Includes Disabled Servers and "Hyper-V Server*" | |
| Get-ADComputer -Filter * -Properties Name,OperatingSystem,OperatingSystemVersion,Enabled -ResultSetSize 1000000 | | |
| Where-Object {$_.OperatingSystem -notlike "Windows*"} | | |
| Select-Object Name,Enabled,OperatingSystem,OperatingSystemVersion | Sort-Object Name | FT -AutoSize | |
| # ,OperatingSystemHotfix,OperatingSystemServicePack | |
| } |
OlderNewer