如何禁止更改系统时间域用户更改计算机名和退出域

求助:windows 7不退出域修改计算机名脚本
求助:windows 7不退出域修改计算机名脚本
9:53:00来源:
以下为XP下可生效的不退出域改计算机名脚本。windows7不可以用。两个系统之间存在什么差异性吗?
Set objnet = CreateObject (&WScript.Network&)
Set R = CreateObject(&WScript.Shell&)
reval = InputBox (&新的计算机名为您计算机的资产编号&,&当前的计算机名是:& & puterName,&输入新的计算机名&)
On Error Resume Next
strComputer = &.&
Set objWMIService = GetObject(&winmgmts:& _
& &{impersonationLevel=impersonate}!\\& _
& strComputer & &\root\cimv2&)
Set colComputers = objWMIService.ExecQuery _
(&Select * from Win32_ComputerSystem&)
For Each objComputer in colComputers
errReturn = ObjComputer.Rename (reval)
If reval && && Then
return=MsgBox (&你确定要重起计算机吗?&,vbOKCancel+vbexclamation,&注意!&)
If return=vbok Then
R.run(&Shutdown.exe -r -t 0&)通过组策略禁止有本地管理员权限的域用户更改网络配置
没有管理员权限的用户,默认就没有权限更改计算机的IP地址。本示例主要用于禁止管理员来更改计算机的IP地址,登录的用户都是计算机的本地管理员。
Network Connections服务管理&网络和拨号连接&文件夹中对象,在其中您可以查看局域网和远程连接。如果停止该服务,用户将不能访问本地连接来更改IP地址。
本示例能够控制包括本地用户和域用户、普通用户以及管理员来通过本地连接属性修改IP地址。
如果允许域管理能够修改客户计算机的IP地址,可以将Network Connections服务启动类型设置为&手动&,设置该服务的安全性只允许域管理员能够启动。
方法如下:
1、设置组策略将要禁止更改IP的部门的计算机Network Connections设置成手动启动
2、设置Network Connections只允许domain Admins组能够完全控制,其他所有人(everyone)只读&
【声明】:黑吧安全网()登载此文出于传递更多信息之目的,并不代表本站赞同其观点和对其真实性负责,仅适于网络安全技术爱好者学习研究使用,学习中请遵循国家相关法律法规。如有问题请联系我们,联系邮箱,我们会在最短的时间内进行处理。
上一篇:【】【】1234人阅读
自动加域脚本 /改计算机名/加域/加用户到本地管理员组
一共有三个脚本。第一个是改计算机名然后重启。第二个是加域和加用户账号到本地管理员组。第三个是删除痕迹和重启这里计算机名的命名方法是:cis+ domainaccount+00 (site 简写+用户账号+用户第几台计算机,可以根据需要调整计算机名你只需要运行第一个脚本 changename.vbs 然后会弹出一个窗口叫你输入计算机名。余下的就有脚本帮你完成了。changename.vbs'**************************************************************************************************************'Description: Change computer name reboot the system and auto login system with administrator''author: [email]Bo.[/email]'time&&: 08/30/2010''**************************************************************************************************************'Option Explicit'On Error Resume NextConst HKEY_LOCAL_MACHINE = &HDim strComputerDim newComputerNameDim strKeyPathDim strKeyPathTCPIPDim objRegDim objSysInfo'Dim computerPath'Dim arrDirectoryLocation()'Dim i'Dim strLocation'Dim ouPathstrComputer = "."strKeyPath = "SYSTEM/CurrentControlSet/Control/ComputerName/"strKeyPathTCPIP = "SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/"Set objReg = GetObject("WinMgmts:{impersonationLevel=Impersonate}!//" & _& && && && && && && && && && &&&strComputer &"/root/default:StdRegProv")Set ShellObj = WScript.CreateObject("WScript.Shell")'*****************************************************make the script run one when system startShellObj.RegWrite "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/RunOnce/addtodomain", "c:/windows/addtodomain.vbs"Set FSO = WScript.CreateObject("Scripting.FilesystemObject")'****************************** copy files to local FSO.CopyFile "addtodomain.vbs", "c:/windows/addtodomain.vbs"& &Set NetObj& & = WScript.CreateObject("WScript.Network")WinDir = FSO.GetSpecialFolder(0)SysDir& && &&&= FSO.GetSpecialFolder(1)On Error Resume NextWinPass="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon/"& && && && && && && && && &&&'Call changeRegInfo(newComputerName) 'Call AutoLogon'Call shutdown& &'**************************************FUNCTIONS************************************************************************& &'Function changeRegInfo(newComputerName)& &newComputerName = InputBox ("inpute your computer name")objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPathTCP,"Hostname"objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPathTCP,"NV Hostname"objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "ComputerName/",_& && && && && && && && && && && && && && &&&"ComputerName",UCase(newComputerName)objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "ActiveComputerName/",_& && && && && && && && && && && && && && && &"ComputerName",UCase(newComputerName)objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPathTCPIP,"Hostname",LCase(newComputerName)objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPathTCPIP,"NV Hostname",LCase(newComputerName)'End Function'*************************************************************************************************************************Dim objFsoSet objFso = WScript.CreateObject("Scripting.FileSystemObject")objFso.CopyFile "addtodomain.*", "c:/windows"''*************************************************************************************************************************'Function AutoLogon& &Dim sUser, sPass'& &sUser = InputBox("Enter Username to Autologin")'& &sPass = InputBox("Enter Password")& & sUser = "administrator"& & sPass = "LSI1AdMiN"& &ShellObj.RegWrite WinPass & "AutoAdminLogon","1","REG_SZ"& &ShellObj.RegWrite WinPass & "DefaultPassword", sPass, "REG_SZ"& &ShellObj.RegWrite WinPass & "DefaultUserName", sUser,"REG_SZ"& &'Set ShellObj = WScript.CreateObject("WScript.Shell")&&'&&shellobj.Run " /k"&"shutdown -r -t 0"'&&WScript.QUIT " /k"&'End Function& &'*************************************************************************************************************************Set ShellObj = WScript.CreateObject("WScript.Shell")&&& &shellobj.Run "shutdown -r -t 0"'*************************************************************************************************************************第二个脚本 你需要在红色部分根据需要添加你公司的域和你的加入域时用的账号和密码'*************************************************************************************************'Description: Join domian and add user account to local administrators group and reboot the system'& &&&author:Bo.'& && & Date:08/30/2010'**************************************************************************************************Const JOIN_DOMAIN& && && && & = 1Const ACCT_CREATE& && && && & = 2Const ACCT_DELETE& && && && & = 4Const WIN9X_UPGRADE& && && &&&= 16Const DOMAIN_JOIN_IF_JOINED& &= 32Const JOIN_UNSECURE& && && &&&= 64Const MACHINE_PASSWORD_PASSED = 128Const DEFERRED_SPN_SET& && &&&= 256Const INSTALL_INVOCATION& && &= 262144strDomain& &= "[color=Red]yourdomain[/color]"strPassword = "[color=Red]********[/color]"strUser& &&&= "[color=Red]your account [/color]"Set objNetwork = CreateObject("WScript.Network")strComputer = puterNameSet objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!//" & _& && && && && && & strComputer & "/root/cimv2:Win32_ComputerSystem.Name='" & _& && && && && && & strComputer & "'")ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _& && && && && && && && && && && && && && && && &strPassword, _& && && && && && && && && && && && && && && && &strDomain & "/" & strUser, _& && && && && && && && && && && && && && && && &NULL, _& && && && && && && && && && && && && && && && &JOIN_DOMAIN + ACCT_CREATE)'**********************************************************************************************' add useraccount to local admin group'***********************************************************************************************Dim useraccountSet net = WScript.CreateObject("WScript.Network")local = puterNameuseraccount =Left(local,Len(local)-2)useraccount=Right(useraccount,Len(useraccount)-3)MsgBox useraccountDomainName = "lsi"set group = GetObject("WinNT://"& local &"/Administrators")on error resume nextgroup.Add "WinNT://"& DomainName &"/"& UserAccount &""CheckErrorsub CheckError& & & & if not err.number=0 then& & & & set ole = CreateObject("ole.err")& & & & MsgBox ole.oleError(err.Number), vbCritical& & & & err.clearelse& & & & MsgBox "Done."end ifend sub'**********************************************************************************************'disable admin auto logon and reboot the system the system'**********************************************************************************************WinPass="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon/"Set ShellObj = WScript.CreateObject("WScript.Shell")ShellObj.RegWrite WinPass & "AutoAdminLogon","0","REG_SZ"'**********************************************************************************************'delete teh addtodomain in c:/windows'**********************************************************************************************ShellObj.Run ("""c:/windows/addtodomain.bat""") ', 0, True 'shellobj.Run "shutdown -r -t 0"第三部分是 重启删去在用户计算机里的脚本'**************************************************************************************************************addtodomain.bat (起这个名字跟第二个相同时应为我再用vbs copy 时我图省事,把addtodomain.* 都拷贝到本地。自然addtodomain.bat 也copy 过来的)(Dim objFsoSet objFso = WScript.CreateObject("Scripting.FileSystemObject")objFso.CopyFile "addtodomain.*", "c:/windows" )'**************************************************************************************************************del /q c:/windows/addtodomain.vbs shutdown -r -t 0
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:5853次
排名:千里之外
(1)(1)(2)(4)&热门教程推荐
12345678910
&热门系统专题
&Win7系统推荐
&|&&|&本站发布的系统与软件仅为个人学习测试使用,请在下载后24小时内删除,不得用于任何商业用途,否则后果自负,请支持购买微软正版软件!
如侵犯到您的权益,请及时通知我们,我们会及时处理。
Copyright @ 2011 系统城您现在的位置: &
技术知识库
Win10系统下如何更改计算机名、域和工作组
文章编号:133118&&&&& 12:02:15
适用范围:Windows 10预览版操作步骤:1、在桌面上找到“此电脑”然后鼠标右击“此电脑”选择“属性”,如下图:
2、找到计算机名、域和工作组设置,选择“更改设置”,如下图:
3、若要修改计算机名域和工作组,选择“更改”,如下图:
4、进入设置后,选择对应的选项进行修改即可。
5、注意:修改好后,必须重新启动电脑才能生效。
声明:联想网站提供的技术方案或与您产品的实际情况有所差异,您需在完整阅读方案并知晓其提示风险的情况下谨慎操作,避免造成任何损失。
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
如果您对本文章有任何疑问或想进一步了解相关问题,请通过进行交流。&&
如果您需要其他帮助请访问 &也可以通过
获得技术支持

我要回帖

更多关于 禁止更改主页设置 的文章

 

随机推荐