How to populate computer description with %username%

Archived from groups: microsoft.public.windowsxp.customize (More info?)

Does anyone know if there is a way to automatically change the computer
description to the name of the user logged on. (using a variable %username%)


Many Thanks

--
miss wje
1 answer Last reply
More about populate computer description username
  1. Archived from groups: microsoft.public.windowsxp.customize (More info?)

    You may use this script to accomplish the task. Copy the lines below to a
    Notepad document and save the file as "PC-Desc.vbs"

    ------------------------------------------------------------------
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    MyDesc=WshNetwork.UserName
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

    For Each objOperatingSystem in colOperatingSystems
    objOperatingSystem.Description = MyDesc
    objOperatingSystem.Put_
    Next

    Set WshNetwork = Nothing
    ------------------------------------------------------------------

    When you run the script, it sets the computer description to the currently
    logged on user name.

    --
    Ramesh, Microsoft MVP
    Windows XP Shell/User
    http://windowsxp.mvps.org


    "wje" <wje@discussions.microsoft.com> wrote in message
    news:9683C05F-9447-4979-A42A-9F06EC9038C3@microsoft.com...
    > Does anyone know if there is a way to automatically change the computer
    > description to the name of the user logged on. (using a variable
    > %username%)
    >
    >
    > Many Thanks
    >
    > --
    > miss wje
Ask a new question

Read More

Configuration Microsoft Customization Computers Windows XP