Monday, December 11, 2017

[O365] Change/remove groups and teams SMTP addresses




  • List all groups and their addresses:



Get-UnifiedGroup | fl alias,*primary*,*emailadd* 

  • Change primary SMTP

Get-UnifiedGroup group1 | Set-UnifiedGroup -PrimarySmtpAddress group1@newdomain.tech

  • Remove SMTP address from old domain:

Get-UnifiedGroup group1 | Set-UnifiedGroup -EmailAddresses @{remove="group1@olddomain.com"}

  • List group addresses:

Get-UnifiedGroup group1 | fl alias,*primary*,*emailadd* 

Friday, October 13, 2017

[WIN] Recover lost/missing system tray icons



$registryPath = "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify"
$Name1 = "IconStreams"
$Name2 = "PastIconsStream"
$value = $null
New-ItemProperty -Path $registryPath -Name $Name1 -Value $value -PropertyType BINARY -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $Name2 -Value $value -PropertyType BINARY -Force | Out-Null
Get-Process explorer | Stop-Process -Force
.

Sunday, September 24, 2017

[LY13] Export address book to file



abserver -dumpfile "C:\LyncShare\n-WebServices-n\ABFiles\00000000-0000-0000-0000-000000000000\00000000-0
000-0000-0000-000000000000\F-0ef3.lsabs" c:\ABS-dump26Jun.txt

Sunday, August 27, 2017

[WSRV] Script to Block .Net 4.7


$registryPath = "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\WU"
New-Item -Path $registryPath -Force | Out-Null
$Name = "BlockNetFramework47"
$value = "1"
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null

Saturday, August 5, 2017

Sunday, July 23, 2017

[LY13] Capture AutoD records




reg.exe query HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Lync\user001@domain.com.br\Autodiscovery
reg.exe query HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Lync\user001@domain.com.br\LyncAutodiscovery

[EX2013] Deploy MaxConcurrentApi



# deploy MaxConcurrentApi key in multiple Exchange servers
Get-Exchangeserver | foreach{Invoke-Command -ComputerName $_.fqdn -ScriptBlock {
    $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters"
    $Name = "MaxConcurrentApi"
    $value = "10"

    IF(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -Force | Out-Null
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}
    ELSE {
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}

    restart-service netlogon -Force
}}

# deploy MaxConcurrentApi key in multiple DC servers. This is captured from the “currentDomainControllers” result.
(Get-Exchangeserver servername -Status).CurrentDomainControllers | foreach{Invoke-Command -ComputerName $_ -ScriptBlock {
    $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters"
    $Name = "MaxConcurrentApi"
    $value = "10"

    IF(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -Force | Out-Null
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}
    ELSE {
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}

    restart-service netlogon -Force
}}