Posts Tagged ‘Scripting’

h1

Export Computer list from AD

October 21, 2008

I find myself using this quite often so I figured I would post here for a nice copy and paste for future uses.  ;)
*Requires Windows 2003 Admin tools (adminpak.msi) to be installed

Export computer objects from a specified OU and all sub OU’s(careful of wordwrap):

dsquery computer “ou=laptops,ou=devices,ou=site,dc=subdomain,dc=domain,dc=com” -limit 0 -o samid >>Laptops.txt

-limit 0 tells the script to return ALL matching values (Default is 100)
-o samid tells the script to return the “friendly” name. (Default is the full DN)

Obviously replace the values with ones specific to your environment.  ;)

h1

Windows PE 2.0 AD Scripting requirements

September 27, 2008

 From the Vista install.wim or from a Vista machine retrieve the following files (located in the System32 directory):

adsldp.dll
adsnt.dll
mscoree.dll
mscorier.dll
mscories.dll

Mount your Windows PE boot image using imagex.
Example:
imagex /mountrw c:\PathToPEWim\WinPE.wim 1 c:\Mounted_Images

Copy the dll files above to c:\Mounted_Images\Windows\System32

Using regedit, load the SOFTWARE hive from your PE 2.0 Boot WIM and call it PE_Software.
(Location of the Software hive:
c:\Mounted_Images\Windows\System32\config\SOFTWARE)

Save the text below as a reg file. With the PE_Software hive loaded, import the registry key. UNLOAD the hive when finished to save the changes.
Unmount and commit changes to your PE wim image. Read the rest of this entry ?