+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
Windows Thread, Scripting new SID for PCs in Technical; I suppose that is possible. Maybe Ghost allows you to specify "rules" for naming as you say....
  1. #16

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,345
    Thank Post
    242
    Thanked 1,602 Times in 1,278 Posts
    Rep Power
    346
    I suppose that is possible. Maybe Ghost allows you to specify "rules" for naming as you say.

  2. #17
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,514
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    You can run a logon script to change the comp name, all you have to do is change the script so that it puts a random jumble of say 5 numbers and letters at the end, but this takes away naming conventions that you may wish to have in place.

    This script will re-name the pc to "computer1" then force a reboot of the computer.

    On Error Resume Next

    Const wbemFlagReturnImmediately = &h10
    Const wbemFlagForwardOnly = &h20

    strComputer = "."
    strNewComputername = "computer1"

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _
    wbemFlagReturnImmediately + wbemFlagForwardOnly)

    For Each objComputerSystem in colItems
    objComputerSystem.Rename(strNewComputername)
    Next

    On Error Resume Next

    Const wbemFlagReturnImmediately = &h10
    Const wbemFlagForwardOnly = &h20

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
    wbemFlagReturnImmediately + wbemFlagForwardOnly)

    For Each objOperatingSystem in colItems
    objOperatingSystem.reboot()
    Next

  3. #18
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,987
    Thank Post
    275
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    48
    Sorry, I was busy today. The 5000 do have unique names. All equipment is allotted an asset number, which formed the PC name. Recently that changed to service tag for the PC's, but still, the current name must stay, so Steve's original idea was good - take the current name and name the PC that.

    Sorry not to have added that earlier

    (we currently run Netware (client 4.91 sp5))

  4. #19
    DrPerceptron's Avatar
    Join Date
    Dec 2008
    Location
    In a house
    Posts
    932
    Thank Post
    37
    Thanked 135 Times in 115 Posts
    Rep Power
    42
    If they are Dell systems, you can pull the Service Tag out of Win32_BaseBoard namespace (I think, I can pull the STag for my laptop out of it...)

    Likewise, if you didn't mind visiting all the PC's, you can leave the computername part out of sysprep.inf and it will ask you to enter the name of the PC before carrying on it's way.

  5. #20
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,987
    Thank Post
    275
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    48
    Yeah I need to use the existing name and no interaction.

  6. #21

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,159
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    125
    OK; it's taken a bit of time but I've finally come up with a script which I think will work. I've written a blog posting to describe it - let me know if you think it will be of any use!

  7. Thanks to srochford from:

    mark (14th January 2009)

  8. #22
    tjb
    tjb is offline
    tjb's Avatar
    Join Date
    Mar 2008
    Location
    Townsville
    Posts
    38
    Thank Post
    4
    Thanked 6 Times in 4 Posts
    Rep Power
    15
    Great work Steve, I'd like to try this script out tomorrow however when I tried to download the zip file it appears to be corrupt. If you could please check it out that would be great.

  9. #23

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,374
    Thank Post
    906
    Thanked 1,811 Times in 1,559 Posts
    Blog Entries
    12
    Rep Power
    468
    not had time to read this properly, but i have a startup script that will do this doesn't take long to run either.

    If your interested let me know

    Z

    If i have the script here, you don't need to rejoin the machines on the domain. I had the same problem when i started my old job.

    net stop wuauserv
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v AccountDomainSid /f
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v PingID /f
    REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Wi ndowsUpdate" /v SusClientId /f
    net start wuauserv
    wuauclt /resetauthorization /detectnow
    Last edited by FN-GM; 14th January 2009 at 01:22 PM.

  10. #24

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,159
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    125
    Attachment seems OK here but I've uploaded it with this message. If that doesn't work, email me - s.rochford@imperial.ac.uk - and I'll send it to you directly.
    Attached Files Attached Files

  11. 2 Thanks to srochford:

    mark (14th January 2009), tjb (16th January 2009)

  12. #25

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,159
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    125
    Quote Originally Posted by FN-GM View Post
    not had time to read this properly, but i have a startup script that will do this doesn't take long to run either.

    If i have the script here, you don't need to rejoin the machines on the domain. I had the same problem when i started my old job.
    That's the wrong SID - that just deals with machines in Windows Update - not the ID that's used for security purposes (although if the machines have been cloned without that change making then it does make sense to do that)

  13. Thanks to srochford from:

    FN-GM (16th January 2009)

  14. #26
    tjb
    tjb is offline
    tjb's Avatar
    Join Date
    Mar 2008
    Location
    Townsville
    Posts
    38
    Thank Post
    4
    Thanked 6 Times in 4 Posts
    Rep Power
    15
    Quote Originally Posted by srochford View Post
    Attachment seems OK here but I've uploaded it with this message. If that doesn't work, email me - s.rochford@imperial.ac.uk - and I'll send it to you directly.
    Thanks Steve, the problem was my laptop (Vista Ultimate 64bit) said the zip file was corrupt and wouldn't open it! I managed to open it OK on an XP box though...

    Thanks again, I'll let you know how the testing goes...

  15. Thanks to tjb from:

    mark (23rd January 2009)

  16. #27
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,987
    Thank Post
    275
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    48
    We're not at testing phase yet here Steve. Still tidying user accounts . Will let you know when the time comes.



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. os x scripting
    By mac_shinobi in forum Mac
    Replies: 5
    Last Post: 22nd August 2008, 10:30 AM
  2. Scripting and msi's
    By stu in forum How do you do....it?
    Replies: 5
    Last Post: 26th June 2008, 07:47 PM
  3. SID Migration W2k3 -> W2k3
    By adamf in forum Windows
    Replies: 3
    Last Post: 19th June 2008, 04:51 PM
  4. New to scripting
    By FN-GM in forum Scripts
    Replies: 26
    Last Post: 10th August 2007, 11:31 PM
  5. Win32 SID path - linking sims to AD
    By jrubinstein in forum How do you do....it?
    Replies: 2
    Last Post: 22nd June 2007, 10:40 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •