MAC address as host name - auto populate, etc.
-
Thanks for the reply,
It seems like putting the serial in “Computer Description” might be better than trying to put it in the hostname, so I guess that would be my goal, yes. In simpler terms, getting the serial into Active Directory in some form is the MAIN goal, and “Computer Description” would seem to be the best and more appropriate place/way for this, rather than the hostname.The problem with doing it via VBScript snapin is that is another thing to write/manage/push/worry about, and I would rather just have it be mechanized as part of the FOG Service. However, I will certainly try it that way as time allows.
Would a VBScript pull the serial from the SQL database, or from the local machine? Off the top of my head, I cannot remember if Windows stores the motherboard serial somewhere, but you would think so…
Also, cloning machines with/without sysprep might cause a VBScript to pull an incorrect serial if it’s pulling it from the local machine.
Thanks,
D.L. -
We implemented this last year so some of the information may have been changed with out being documented, but this is the script we used. Keep in mind this only updates the description in AD not on the computer itself.
You also have to change ad permissions.
Open ADUC
Right click on domain select properties -> security -> advanced -> add
Type Authenticated Users -> OK -> properties
Change [U]Apply to:[/U] to [U]Descendant Computer Objects[/U] and allow Write Description[CODE]DIM objSysInfo, objWMI, objComputer
SET objWMI = GetObject(“winmgmts:{impersonationLevel=impersonate}!\.\root\cimv2”)'Get OU
SET objSysInfo=createobject(“adsysteminfo”)'Set computer description; will not update field if description is current or if it starts with an “!”
FOR EACH objSMBIOS IN objWMI.ExecQuery(“Select * from Win32_SystemEnclosure”)
serviceTag = replace(objSMBIOS.SerialNumber, “,”, “.”)
manufacturer = replace(objSMBIOS.Manufacturer, “,”, “.”)
NEXT
FOR EACH objComputer IN objWMI.ExecQuery(“Select * from Win32_ComputerSystem”)
model = trim(replace(objComputer.Model, “,”, “.”))
NEXT
SET objComputer = GetObject(“LDAP://” & objSysInfo.ComputerName)
newDescription = “(” & serviceTag & " / " & model & “)”
IF NOT objComputer.Description = newDescription AND NOT left(objComputer.Description,1) = “!” THEN
objComputer.Description = newDescription
objComputer.SetInfo
END IF[/CODE] -
you might find this link interesting [url]http://deployhappiness.com/find-serial-numbers-in-active-directory/[/url]
-
Thanks for the replies,
These are both good directions to point, and thank you for the suggestions. If/when I have time to try these, I will…However, it would still be better if it was integrated as part of the FOG Service, or the main FOG installation, IMHO. Of course this will sound lazy, but having the work already done and having it mechanized, automated, and in the background is always better.
That it probably the single greatest thing about FOG and the FOG Service, it WORKS - yes, there are ways to do everything that FOG and the FOG Service do independently, on your own, but I would never be able to get them working. The deployhappiness.com link illustrates this perfectly as the comment section is full of folks having trouble with it, trying to get it to work, etc. and undoubtedly that would be me as well and I would probably just give up before I got it working…
That’s why you guys are developers and I’m just a user, haha!
Thanks again for all of your work and help,
D.L. -
I just wanted to add that I do understand that basic scripting is not the same as developing, and is generally part of the job, but I’m sure that I will have some trouble getting this to work.
I will try it and report back, thanks again for all of the assistance and the great work on FOG,
D.L. -
If you need help, Convo me (not everybody all at once), but I can try to assist and direct where you may need it.