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 Get-CertificationAuthority ([string]$CAName) | |
{ | |
$domain = ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).Name | |
$domain = “DC=” + $domain -replace ‘\.’, “, DC=” | |
$CA = [ADSI]“LDAP://CN=Enrollment Services, CN=Public Key Services, CN=Services, CN=Configuration, $domain” |
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
Find Disabled Active Directory Accounts Who are Still Lync Enabled | |
# Credit: http://www.ehloworld.com/265 | |
Get-CsAdUser| Where-Object {$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled -eq $true} | Format-Table Name,Enabled,SipAddress -auto | |
And, if you want, can disable them in one line using | |
Get-CsAdUser | Where-Object {$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled} | Disable-CsUser -Verbose | |
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-eventlog system | where-object {$_.eventid -eq 6006} | select -first 10 |
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
$Group = "groupname" | |
Get-ADGroupMember -Identity "$Group" | Get-ADUser | Select-Object GivenName,Surname,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
Get-CsService -ConferencingServer | fl Identity,*port* | |
Get-CsService -ApplicationServer | fl Identity,*port* | |
Get-CsService -MediationServer | fl Identity,*Port* | |
Get-CsMediaConfiguration | fl | |
Get-CsUCPhoneConfiguration | fl | |
Get-CsConferencingConfiguration | fl | |
# Credit http://guybachar.wordpress.com/2014/05/28/script-lync-qos-quality-of-service-configuration-report/ |
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 Extension from TelURI | |
$LineURI = "$($GetCSUser.LineURI) " | |
$regex = $LineURI | Select-String -Pattern "tel:\+(?:[0-9]+)+;ext=(?<1>(?:[0-9]+)+)" | |
$extension = $regex.Matches[0].Groups[1].Value | |
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-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall" | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object {($_.DisplayName -imatch "Microsoft Lync Server") -or ($_.DisplayName -imatch "Microsoft Office Web Apps Server 2013") -or ($_.DisplayName -imatch "Unified Communications")} | Sort-Object DisplayVersion -Descending | Select-Object DisplayName,DisplayVersion |
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
$longnames = Get-ChildItem -Path "C:\Users\Tom\OneDrive\Documents\Microsoft\Nexthop Archive\" -Recurse | select-object fullname,name, @{Name="Nlength";Expression={$_.Name.Length}} | Where-Object Nlength -GT 35 | |
Foreach ($name in $longnames) | |
{ | |
$newname = "$($name.Name.Substring(0,6))" + ".html" | |
Write-Host $newname | |
Rename-Item -Path $name.Fullname -NewName $newname | |
} |
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-ChildItem -Path c:\ -Recurse | Sort-Object Length -Descending | Select-Object length,name,directory -First 100 | Format-Table -AutoSize |
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-Process | Where-Object {$_.ProcessName -eq "Explorer"} | Stop-Process -Force |