Specify a server during an [ADSI] command


function get-adobjectou {  # ----------------------------------------------------------------------------------------------  # function outputs objects containing ou  #  - requires distinguished name input   #  - outputs containing ou  # ----------------------------------------------------------------------------------------------      param (          [parameter(mandatory=$true,           valuefrompipelinebypropertyname=$true)][alias("dn")][string]$distinguishedname      )            $ou = ([adsi]"ldap://$distinguishedname").parent -replace 'ldap://'      if( $ou.length -eq 0 ) {          write-host -foregroundcolor red "error: parent ou cannot found because distinguishedname not exist."          break      } else {          $ou      }        } # end get-adobjectou

i making several changes before use "-server dc.mydomain.com" , replication not have controllers date for a few seconds.  want sure using same dc used make changes prior command. 

how can specify server use in above example?


find post helpful? post answer question? sure mark appropriately others find answers searches.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file