Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Problems with logon in windows 2008 when trying to run a VBS script

Avatar of eltel-it-nor
eltel-it-norFlag for Norway asked on
Microsoft Legacy OSMicrosoft Server OS
3 Comments1 Solution661 ViewsLast Modified:
Greetings!

This script worked without problems in a 2003 R2 Domain, But when trying to run it in a 2008 domain nothing seems to happen.

On a client when gpresult /R is run Model.vbs is an applied Group Policy Object


Model.vbs :

'-----------------------------------------------------------------------
' Created 3/29/2011
' When used as login script it will populate the Computer Description
' in Active Directory with UserName, Serial Number & Computer Model
' ----------------------------------------------------------------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colcomputersystem = objWMIService.ExecQuery _
        ("Select * from Win32_computersystem")
Set colBIOS = objWMIService.ExecQuery _
    ("Select * from Win32_BIOS")
For each objcomputersystem in colcomputersystem
    Getcomputersystem = objcomputersystem.Model
Next
    For each objBIOS in colBIOS
GetSerialNumber = objBIOS.SerialNumber
    Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
strMessage = objUser.CN & " / " & GetSerialNumber & " / " & Getcomputersystem
objComputer.Description = strMessage
objComputer.SetInfo
ASKER CERTIFIED SOLUTION
Avatar of Miguel Angel Perez Muñoz
Miguel Angel Perez MuñozFlag of Spain image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers