Script – Join a Computer to the Domain

Join the local computer to the domain without prompting  using a specific account and reboot once finished.

Add-Computer -DomainName testdom.local -NewName Server22 -Credential testdom\administrator -Restart -Force
Advertisements

Script – New AD Forest

This PowerShell script will deploy a new root forest with a forest and domain level of Windows Server 2012 R2.

Import-Module ADDSDeployment
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "Win2012R2" `
-DomainName "test.local" `
-DomainNetbiosName "TEST" `
-ForestMode "Win2012R2" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-Force:$true

 

Activities Stuck in Pending Status

Occasionally you can get a Change Request or Service Request that has activities stuck in a pending state.  This can occur for a variety of reasons the most common of which are:

  • You use PowerShell that creates the Change or Service Request, and then applies a template that contains activities
  • You manually apply a template with activities in it
  • You use PowerShell or Orchestrator to create a Change or Service Request and set the status of the Change or Service Request to “In Progress”

Thankfully there is an easy fix without hacking individual activities.  Put the parent Work Item (Change or Service Request) On Hold, then wait for all child activities to also take the On Hold status, then change the parent Work Item status to In Progress.

This can be achieved manually through the console, or via PowerShell.