Skip to content

Instantly share code, notes, and snippets.

@nullbind
Last active July 11, 2020 12:12
Show Gist options
  • Save nullbind/79b2b090824e9b34f55aae08afac9627 to your computer and use it in GitHub Desktop.
Save nullbind/79b2b090824e9b34f55aae08afac9627 to your computer and use it in GitHub Desktop.
This is an example of how to import the Active Directory and GPO command PowerShell modules on the fly.
This file has been truncated, but you can view the full file.
# ---------------------------------------------------
# Load the Active Directory PowerShell module
# ---------------------------------------------------
# $ADModuleBytes = [System.IO.File]::ReadAllBytes("C:\Windows\Microsoft.NET\assembly\GAC_64\Microsoft.ActiveDirectory.Management\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ActiveDirectory.Management.dll")
# $ADModuleString = [System.Convert]::ToBase64String($ADModuleBytes)
# Set the string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment