Change Computername And Join Domain

Testing this stuff!

3.
It is also possible to specify user credentials within a script; this enables you to do such things as log on to a computer using a standard user account, yet still run a script that requires administrator privileges. For more information, go to http://msdn.microsoft.com/library/default.asp and search for “Creating a WMI Script.”

wbemImpersonationLevelImpersonate = 3
wbemAuthenticationLevelPktPrivacy = 6

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer
("TargetComputer", "root\cimv2", "UserName", "Password")
objService.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate
objservices.Security_.AuthenticationLevel = wbemAuthenticationLevelPktPrivacy

http://www.tek-tips.com/viewthread.cfm?qid=1240726&page=1

or

http://cwashington.netreach.net/depo/view.asp?Index=877&ScriptType=vbscript

WMIC.exe is only available under Windows XP Professional, Windows Server 2003, Windows Vista and Windows Server "Longhorn".

wmic /node:"Computer Name (FQDN)" /USER:"username" RDTOGGLE WHERE ServerName="Computer Name" CALL SetAllowTSConnections 1

Rename and joindomainorworkgroup "api" only available on Windows XP. (not 2000)

Rename

wmic computersystem CALL joindomainorworkgroup name='NewNameOfWorkgroup' …

For example, we're often asked, "Why doesn't the Join Computer to a Domain script in TechNet's Script Center work on Windows 2000?" The answer is because the Win32_ComputerSystem class (which is the WMI class used in the script) doesn't support the JoinDomainOrWorkGroup method on Windows 2000. The JoinDomainOrWorkGroup method was added to the Win32_ComputerSystem class in the version of WMI built-in to Windows XP and Windows Server 2003.

source:
http://jamesfinnigan.spaces.live.com/blog/cns!9062539B2F0077D6!432.entry
http://www.dotnetframework.de/scripting/WMIReferenz.asp?C_Klasse=Win32_ComputerSystem
http://msdn2.microsoft.com/en-us/library/ms974592.aspx
http://msdn2.microsoft.com/en-us/library/aa394102(VS.85).aspx
http://en.wikipedia.org/wiki/Windows_Management_Instrumentation
http://www.microsoft.com/technet/scriptcenter/resources/wmifaq.mspx#E4DAC

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.
{"cc_re__cc_re__cc_by_sa_2_5": ["ick=\"WIKIDOT.page.listeners.pageBugReport(event)\">Report a bug</a>\n    &nbsp;|\n    <a href=\"javascript:;\" id=\"abuse-report-button\" onclick=\"WIKIDOT.page.listeners.flagPageObjectionable(event)\">Flag as objectionable</a>\n</div>\nPowered by <a href=\"http://www.wikidot.com\">Wikidot.com</a> \n            </div>\n            \n                <div id=\"license-area\" class=\"license-area\">\n                    Unless otherwise stated, the content of this page is licensed under <!--Creative Commons License--> <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/2.5/\">Creative Commons Attribution-Share Alike 2.5  License</a>.<!--/Creative Commons License--><!-- <rdf:RDF xmlns=\"http://web.resource.org/cc/\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n\t<Work rdf:about=\"\">\n\t\t<license rdf:resource=\"http://creativecommons.org/licenses/by-sa/2.5/\" />\n\t</Work>\n\t<License rdf:about=\"http://creativecommons.org/licenses/by-sa/2.5/\"><permits rdf:resource=\"http://web.resource.org/cc/Reproduction\"/><permits rdf:resour"]}