Category: PowerShell

  • Restore a deleted Active Directory object with PowerShell

    This requires that you have enabled the enable Active Directory Recycle Bin before you deleted the object. Run Windows PowerShell as Administrator. Start by loading the Active Directory module for Windows PowerShell: Import-Module ActiveDirectory List all deleted users (for some reason computer objects also are included when you use objectclass -eq “user): get-adobject -filter ‘objectclass […]

  • Allowing PowerShell executing scripts

    By default PowerShell is restricted to not allow script execution. To allow script execution do the following Open PowerShell in elevated mode (run as administrator) and run the following command: Set-ExecutionPolicy unrestricted To verifiy how if script execution is allowed or not run the following command in PoweShell: Get-ExecutionPolicy