#176582 - 2007-05-30 11:18 AM
ad value in the registry REG_MULTI_SZ
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
Hello, i have to ad a value in the regestry(hardware "MSN-Number")and if i do it right it has to look like this (if i export the key) "IsdnMultiSubscriberNumbers"=hex(7):35,00,33,00,33,00,00,00,00,00
i try this: WRITEVALUE( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0006\0" , "IsdnMultiSubscriberNumbers", "533" , "REG_MULTI_SZ")
but it does not work correctly.
can someone help me? thanks a lot
Attachments
38-howtochancereg.zip (719 downloads) Description:
|
Top
|
|
|
|
#176583 - 2007-05-30 11:20 AM
Re: ad value in the registry REG_MULTI_SZ
[Re: nlinbonn]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
this worked for me:
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security\","name","value","REG_MULTI_SZ")
|
Top
|
|
|
|
#176584 - 2007-05-30 01:09 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: roedie]
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
yes thats works for me to. but i need te "value". it has to be in hex and the first seven characters gives the msn-number and after the eicht character has to be in hex to " 00 00.
it looks like this after: 0000 35 00 33 34 00 00 00 5.3.4... 0008 00 00 ..
but thank you
|
Top
|
|
|
|
#176585 - 2007-05-30 01:33 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: nlinbonn]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
The exported hex values you have to put together sequentially for instance 00 3E F4 becomes 003EF4. Assign that to a variable and write to the registry like the code below.
$hexvalue = "001122335543352545432542"
$=WriteValue('HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0006\0', 'IsdnMultiSubscriberNumbers',$hexvalue,'REG_MULTI_SZ')
|
Top
|
|
|
|
#176598 - 2007-05-30 05:10 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: Les]
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
thanks i will try it tomorrow wenn i start working
|
Top
|
|
|
|
#176599 - 2007-05-30 05:16 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: Les]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
I agree, but it isn't multistring, it's a hex value
|
Top
|
|
|
|
#176618 - 2007-05-31 10:39 AM
Re: ad value in the registry REG_MULTI_SZ
[Re: NTDOC]
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
IT Works !! Thanks i used $Result = "532|" $ReturnCode = WRITEVALUE( "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0006\0" , "IsdnMultiSubscriberNumbers", $Result , "REG_MULTI_SZ")
and now its exactly what i was looking for.
Thanks a lot !!
i have to chance it on many computer i hope the classes ({4D36E972-E325-11CE-BFC1-08002BE10318})are all the same. if it isnt cann i go an other way to chance it?
thanks
|
Top
|
|
|
|
#176625 - 2007-05-31 04:29 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: nlinbonn]
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
thanks. it all works like i need it.
is it possible with kix to chance the computername and put im in the domaine (ADS) ?
|
Top
|
|
|
|
#176628 - 2007-05-31 05:49 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: Mart]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Can with kix as well, quick untested code:
;Rename a Computer
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colComputers = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For Each $objComputer in $colComputers
$=$objComputer.Rename("computernameXP1")
Next
;Join a Computer to a Domain
$JOIN_DOMAIN = 1
$ACCT_CREATE = 2
$ACCT_DELETE = 4
$WIN9X_UPGRADE = 16
$DOMAIN_JOIN_IF_JOINED = 32
$JOIN_UNSECURE = 64
$MACHINE_PASSWORD_PASSED = 128
$DEFERRED_SPN_SET = 256
$INSTALL_INVOCATION = 262144
$objNetwork = CreateObject("WScript.Network")
$strComputer = $objNetwork.ComputerName
$strDomain = "domainname"
$strPassword = "Password"
$strUser = "username"
$objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" + $strComputer + "\root\cimv2:Win32_ComputerSystem.Name='" + $strComputer + "'")
$ReturnValue = $objComputer.JoinDomainOrWorkGroup($strDomain,$strPassword,$strDomain + "\" + $strUser,,$JOIN_DOMAIN + $ACCT_CREATE)
|
Top
|
|
|
|
#176662 - 2007-06-01 12:34 AM
Re: ad value in the registry REG_MULTI_SZ
[Re: Mart]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Yes there are more issues and concerns to be aware of when using KiX to do it. Shelling to NETDOM though is easier, but ADSI code should be all you need to do it. Though as I recall no one has posted a 100% working UDF type solution for it since using NETDOM is rather easy.
Here is a very old post I made with a KiXforms script. I'm sure it could use some code update but you can view it here if wanted.
JoinAD http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Board=2&Number=75216
.
|
Top
|
|
|
|
#176664 - 2007-06-01 09:49 AM
Re: ad value in the registry REG_MULTI_SZ
[Re: Mart]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Haha thx mart
Here is code that uses ADSI to create a comp account. Just coded and tested.
Dim $compname, $ldap, $comp
$compname = "TestPC2" ; can also use @WKSTA
$ldap = GetObject("LDAP://OU=SomeSubOU,OU=SomeOU,DC=SomeDomain,DC=SomeDomainExtention")
$comp = $ldap.Create("Computer","CN=" + $compname)
$comp.Put("samAccountName", $compname + "$")
$comp.Put("userAccountControl", 4096)
$comp.SetInfo
|
Top
|
|
|
|
#176667 - 2007-06-01 11:02 AM
Re: ad value in the registry REG_MULTI_SZ
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Made a new post in COM Scripting ADSI Computer Account Essentials
|
Top
|
|
|
|
#176679 - 2007-06-01 02:17 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: Arend_]
|
nlinbonn
Fresh Scripter
Registered: 2007-05-30
Posts: 6
|
ok now i can create a account and move them in the ADS but what do i need to chance an existing computername in the ads?
apronk,thanks but i dont understand your skript ;Join a Computer to a Domain
im not a scriptwriter
|
Top
|
|
|
|
#176681 - 2007-06-01 04:31 PM
Re: ad value in the registry REG_MULTI_SZ
[Re: nlinbonn]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
Here, I even verified my own code for a change Change "NewPCName" to the new computername u want
Make sure you reboot to make the change go in effect after runinng this script. This will assume you have Network admin privilidges or at least Account Operator privilidges. It will error out if there are none.
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$x = $objWMIService.InstancesOf("Win32_ComputerSystem").Item("Win32_ComputerSystem='"+@WKSTA+"'").Rename("NewPCName")
If $x <> 0
? @SERROR
Exit @ERROR
EndIf
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|