Auto fill the computer description field in AD

In order for this process to work, we will need to allow our authenticated domain users to edit the description values on computer objects. Be aware that by doing this, a malicious or cheeky user on your network could change the description on computer objects to anything they want. Given that mine were all empty, anyway, and that they get overwritten each time someone logs in, I didn’t think this would be a significant problem for me. To grant this access, perform the following steps:

1) Open Active Directors Users and Computers MMC
2) Ensure you have ‘Advanced Features’ enabled (On the ‘view’ menu)
3) Right click on your domain, and select ‘properties’ from the context menu
4) On the ‘security’ tab, click the ‘advanced’ button
5) Click the ‘add’ button, type ‘Authenticated Users’. Then click OK.
6) In the permission entry dialogue, set the ‘apply to’ pull-down menu to ‘Descendant Computer Objects’, then in the permissions section, tick the allow options for ‘Write Description’
7) Click ok and close the ADUS MMC window.

The next stage is to put the script together. You can modify your script to get and insert any data you require, my example saves the username, service tag, and computer make/model – I’ve added a few comments to show what’s going on:

8) create the script: updateADPCDescription.vbs

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
' Get service tag and computer manufacturer
For Each objSMBIOS in objWMI.ExecQuery("Select * from Win32_SystemEnclosure")
serviceTag = replace(objSMBIOS.SerialNumber, ",", ".")
manufacturer = replace(objSMBIOS.Manufacturer, ",", ".")
' Get computer model
For Each objComputer in objWMI.ExecQuery("Select * from Win32_ComputerSystem")
model = trim(replace(objComputer.Model, ",", "."))
' Get computer object in AD
Set objSysInfo = CreateObject("ADSystemInfo")
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
' Build up description field data and save into computer object if different from current description
' We also do not update computers with a description that starts with an underscore (_)
newDescription = WshNetwork.UserName & " (" & serviceTag & " – " & manufacturer & " " & model & ")"
if not objComputer.Description = newDescription and not left(objComputer.Description,1) = "_" then
objComputer.Description = newDescription
end if

If you run this script as a regular user, then check ADUC, you should find that the computer object that the script was run from, has now a description field set.

9) All that remains now is to add the VBScript to the user login script. I do this via GPO (User configuration > Policies > Windows Settings > Scripts > Logon).
Once your GPO is updated, restart another system, and login again – once more, you should see that computers AD object updated. Now you can stil back and relax while you watch your computer objects in AD fill up with useful information in the description field.

source: 4sysops & spiceworks

Posted at 10am on 07/31/14 | No Comments » | Filed Under: Techie

Make USB Bootable

0.Mount the ISO
1.Insert the USB flash drive into a computer running the Windows Vista or Windows 7 operating system.
2.Open a command prompt.
3.In the command prompt window type diskpart
4.Type list disk
5.Make note of the drive number representing your USB drive.
6.Type select disk <#> where <#> is the number of the USB drive discovered above.
7.Type clean
8.Type create partition primary
9.Type select partition 1
10.Type active
11.Type format fs=fat32 quick
12.Type assign
13.Type list volume
14.Make note of the drive letter representing your USB drive and the CD or DVD drive.
15.Type exit
16.Close the command prompt window
17.Open Windows Explorer and copy the entire contents of the ISO to the flash drive.

Posted at 8am on 06/10/14 | No Comments » | Filed Under: Techie