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
}}

Saturday, June 17, 2017

[EX2013] OWA and ECP redirect to the FBA page



http://support.microsoft.com/kb/3032024/EN-US


Exchange 2013 does not support Microsoft Software Key Storage Provider (CNG)

Check it with "certutil -store my <cert serial number>"

Import PFX file (with private key) in a Windows 7 machine and add the following key before export it as PFX again: 

Path: HKCU\Software\Microsoft\Windows\CurrentVersion\PFX
DWORD: NoProviderName
Value: 1

Import in the Exchange Server with the cmdlet:

certutil -csp "Microsoft RSA SChannel Cryptographic Provider" -importpfx "PFX file path"

[WSRV] Temporarily block installation of the .NET




  • Back up the registry.
  • Start Registry Editor. To do this, click Start, type regedit in the Start Search box, and then press Enter.
  • Locate and click the following subkey:

    HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP
  • After you select this subkey, point to New on the Edit menu, and then click Key.
  • Type WU, and then press Enter.
  • Right-click WU, point to New, and then click DWORD Value.
  • Type BlockNetFramework47, and then press Enter.
  • Right-click BlockNetFramework47, and then click Modify.
  • In the Value data box, type 1, and then click OK.
  • On the File menu, click Exit to exit Registry Editor.
  • Wednesday, March 1, 2017

    [LAB] Exchange 2007 CCR





    Pre-requisites in both Mailbox servers

    Import-Module Server Manager

    Add-WindowsFeature RSAT-ADDS,Web-Server,Web-ISAPI-Ext,Web-Metabase,Web-Lgcy-Mgmt-Console,Web-Basic-Auth,Web-Windows-Auth



    To each MBX server, on Hyper-V:


    • Click on SCSI Controler -> Hard Drive -> Add -> New -> Create a new VHD (one per server)
    • Click on Add Hardware -> Network Adapter -> Add -> Select a private heartbeat network




    Turn on the servers and:


    • Rename NICs, add IPs and Set the correct binding order
    • Bring the disks Online and Initialize them (assign the same letter)
    • In the Server Manager -> Features ->Add Features -> Failover Clustering 





    In the first server


    • Create a Cluster
    • Add all mailbox servers (in validation warning select: I don't require support...)
    • Set name and cluster IP



    Go to a CAS/HUB server


    • Create a folder called FSW_CCR1
    • Share the folder with Everyone and with Cluster Service Account
    • Finally give them Full Control Permissions 




    Back into the mailbox server


    • Open the Failover Cluster Management -> More Actions -> Configure Cluster Quorum Settings
    • Select Node And File Share Majority
    • Browse the Cas/Hub Server and select the Network sharing 
    • Start installation of the Clustered Mailbox servers
    • Select Custom Exchange Server Installation -> Active Clustered Mailbox Role -> Cluster Continuous Replication
    • Add a name for the Clustered mailbox, specify the path for database files in the SCSI disk previously created and specify the IP Address of the Clustered mailbox
    • After completed, proceed with the installation of the other servers selecting Passive Clustered Mailbox Role