Re: use different Roaming Profiles depending on OS



Paul Bergson [MVP-DS] schrieb:
A quick run of Scriptomatic and cleanup can help you do this as seen below. This is a WMI Class

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Next



From the script repository on TechNet, a vbscript
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
Wscript.Echo "Computer Name: " & objOS.CSName
Wscript.Echo "Caption: " & objOS.Caption 'Name
Wscript.Echo "Version: " & objOS.Version 'Version & build
Wscript.Echo "Build Number: " & objOS.BuildNumber 'Build
Wscript.Echo "Build Type: " & objOS.BuildType
Wscript.Echo "OS Type: " & objOS.OSType
Wscript.Echo "Other Type Description: " & objOS.OtherTypeDescription
WScript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & "." & _
objOS.ServicePackMinorVersion
Next



Hello!

Thanks for this answer, but how can I use it to configure an user profile? I have only the opportunity to leave the profil ptah blank or set an profile path.

Thanks a lot!!

*Björn*
.



Relevant Pages

  • Re: How to get System Resources info?
    ... Set colItems = objWMIService.ExecQuery ... For Each objItem in colItems ... > its realted device caption, ...
    (microsoft.public.windowsxp.wmi)
  • Re: temperature disque dur
    ... have you a peace of code for mesure temperature of a disque please ... Set colItems = objWMIService.ExecQuery("Select * from ... For Each objItem in colItems ...
    (microsoft.public.scripting.wsh)
  • Re: Where is ootcimv2SecurityMicrosoftVolumeEncryption?
    ... Set colItems = objWMIService.ExecQuery("SELECT * FROM ... For Each objItem in colItems ... If objItem.DriveLetter = strSDL then ...
    (microsoft.public.scripting.vbscript)
  • Help with WMI script reading from TXT file
    ... of servers.txt is not online then strcomputer stays as the sever on line 7 ... For Each objItem in colItems ... Set colItems = objWMIService.ExecQuery("Select * from ...
    (microsoft.public.scripting.vbscript)
  • Re: Need to check for running services
    ... For Each strComputer In arrComputers ... EnumServices strComputer '<- Pass names here ... "Steve Gould" wrote: ... Set colItems = objWMIService.ExecQuery("SELECT DisplayName, Name, ...
    (microsoft.public.windows.server.scripting)

Loading