Search This Blog

Saturday, March 27, 2021

Error when configuring Azure AD Connect at MSOnline.Format.ps1xml file

Description:

When you configure your Azure AD Connect, you encounter Authorization Manager check failed error message.

It said " Unable to retrieve the Azure Active Directory configuration. Errors occurred while reading the format data file: Microsoft.PowerShell, , C:\Program Files\Microsoft Active Directory Connect\AADPowerShell\MSOnline.Format.ps1xml: The file was skipped because of the following validation exception: AuthorizationManager check failed."



Resolution:

Try to manually installing the Microsoft certificate:

  1.  Go to C:\Program Files\Microsoft Azure Active Directory Connect\AADPowerShell\MSonline.Format.ps1xml
  2. Right click the file, and open properties
  3. Go to 'Digital Signatures' tab and open the details for the certificate
  4. Click View certificate
  5. Click Install certificate for local machine
  6. Manually choose to store certificates at 'Trusted publishers'
  7. Click Ok to close the certificate wizard.
  8. Go Back to the Azure AD Connect Wizard > Click Previous > and Click Next again.


Friday, March 26, 2021

Group Managed Service Accounts (gMSA) - PowerShell Command

Following are several useful group Managed Service Accounts (gMSA) PowerShell command.

  • To query the Active Directory for list of host where a specific gMSA account could be use, please run the following:
    • Get-ADServiceAccount [-Identity] ITFarm1 -Properties PrincipalsAllowedToRetrieveManagedPassword
  • To add member hosts to where the gMSA account could be use, please run the following:
    • Set-ADServiceAccount [-Identity] ITFarm1 -PrincipalsAllowedToRetrieveManagedPassword Host1$,Host3$
  • To install gMSA account to a host, please run the following command on the host machine:
    • Install-ADServiceAccount -Identity ITFarm1
  • To create a new gMSA account, please run the following
    • New-ADServiceAccount ITFarm1 -DNSHostName ITFarm1.contoso.com -PrincipalsAllowedToRetrieveManagedPassword ITFarmHosts$

Removing Extended Rights delegation on AdminSDHolder

Description:

You have Active Directory and Exchange servers running in your environment. One day, the Security team told you that they encounter an account with excessive access on AdminSDHolder container. The Account was "DomainName\Exchange Servers" and has Extended Rights permission of Replication Synchronization. Yow want to remove this excessive access.

First, you try to remove it through the GUI. Open AD User and Computer console, go to System, go to AdminSDHolder container. Right click, open Properties, open Security, and click Advanced. You try to search the "DomainName\Exchange Servers" with permission Replication Synchronization, but couldn't find it.

Second, you try to confirm the existence of the extended rights by running the following command:

DSACLS "CN=AdminSDHolder, CN=System, DC=DomainName, DC=Local"

And you can confirmed the existence of the permission as per below picture:


Third, your try to remove it using Exchange Management Shell, and run the following PowerShell command:

Remove-ADPermission -Identity "CN=AdminSDHolder, CN=System, DC=DomainName, DC=Local" -User "DomainName\Exchange Servers" -ExtendedRights "Replication Synchronization"

However it fails with access denied error.

Resolution:

We can remove the Extended Rights in AdminSDHolder container with the help of LDP.exe

  1. Open LDP.exe
  2. Go to Connection > Click Connect > Click OK
  3. Go to Connection again > Click Bind > Click OK
  4. Click View > Click Tree
  5. Enter the Base DN "DC=DomainName ,DC=Local". Click OK
  6. On the left, double click Domainname, double click "CN=System, DC=DomainName, DC=Local"right click AdminSDHolder container.
  7. Click Advanced > Click Security Descriptor

  8. Check the SACL box > Click OK
  9. Scroll Down until you find the Rights that you want to remove 

  10. Click Delete ACE > Select Yes
  11. Click Update to commit the changes
  12. Close the LDP.exe
Note:
Be careful when removing this "Rights" as it may affect your Exchange Servers behavior. Prior testing is required.

Sunday, March 21, 2021

Prerequisites and Best Practices for Changing ADFS Account

Description:

You have ADFS farm and you want to change the existing ADFS service account. You already have the step by step and the PowerShell module for changing the service account as written at other article in this blog.. However you want to know if there any pre-requisites or problem that you might encounter during the process

Resolution:

The prerequisites for changing the ADFS service account are:

  1. On each machine of the ADFS farm, install the following:
    • Visual C++ Redistributable for Visual Studio 2017
    • ODBC Drive 17 for SQL Server
    • SQLCMD.exe from Microsoft command line utilities for Microsoft SQL Server 2019
  2. Enable AD & AD LDS PowerShell tool from Server Manager on all ADFS server
  3. Domain Admin Account
Best practices:
  1. Run the command to change the service account using Domain Admin Account. Logon Interactively on the ADFS server using Domain Admin, avoid using "Run As".
  2. ADFS services will be restarted during the process. Plan the maintenance time carefully.

Sunday, March 14, 2021

Recover Active Directory after Ransomware Attack if you only have VM Snapshot

Description:

You have a security incident in Active Directory where a ransomware attack encrypt your VCenter infrastructure. All you have left is a backup from a month before the attack.

Resolution:

Although it's not recommended to use VM Snapshot as your Active Directory backup method, in this situation, you can use what you have at the moment.

You can follow the following high-level guidance.

1. Choose the snapshot from time where the malware or malicious file hasn't entered your production environment.

2. Choose to recover only single Domain Controller from the snapshot. Preferable the one who doesn't hold the Flexible Single Master Operation (FSMO) role. The rest of the DC will be build manually from fresh using AD replication.

3. Perform recovery at isolated network.

4. Make sure the Active Directory recover successfully. Make sure SYSVOL and NETLOGON are shared properly. 

5. Seize FSMO to the recovered Domain Controller. Perform metadata cleanup of the rest of DCs.

6. Increase RID pool number.

7. Reset all High Privilege account password twice.

8. Update security patches and Antivirus.

9. Connect new Domain Controller to the production network.

10. Re-create Users or Re-join Computer as needed.

11. Continue building new Domain Controller from clean machine as needed.

Note*:

The guidance assume you are able to get the snapshot from the time before the attack occur. Sometimes this attack could start many months in advance which make recovering from snapshot have less benefit.


 

Search Google