Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Ajoute le groupe Admins_global dans le groupe administrateurs
- ' Créé un utilisateur local et l'ajoute dans le groupe Administrateurs.
- ' Installe la police W92.FON,
- ' Copie le raccourcie MFGPRO sur le bureau de l'utilisateur
- ' Installe Access 97
- ' Il fait un inventaire du poste
- '
- '
- ' Wackou
- ' contact@wackou.com
- ' www.wackou.com
- If WScript.Arguments.length =0 Then
- Set objShell = CreateObject("Shell.Application")
- 'Pass a bogus argument with leading blank space, say [ uac]
- objShell.ShellExecute "wscript.exe", Chr(34) & _
- WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
- Else
- Dim strDomainGroup, strLocalGroup, strLocalGroup2, Action
- Action = "Add" ' or Remove
- strLocalGroup = "Administrators"
- strLocalGroup2 = "Administrateurs"
- strDomainGroup = "admins_global"
- On Error Resume Next
- Dim strDomain, strComputer
- Dim objNetwork, objLocalGroup, objDomainGroup
- Set objNetwork = CreateObject("WScript.Network")
- strDomain = objNetwork.UserDomain 'DOMAINE
- strComputer = objNetwork.ComputerName 'NOM DU PC
- Set objLocalGroup = GetObject("WinNT://" & _
- strComputer & "/" & strLocalGroup)
- Set objLocalGroup2 = GetObject("WinNT://" & _
- strComputer & "/" & strLocalGroup2)
- Set objDomainGroup = GetObject("WinNT://" & _
- strDomain & "/" & strDomainGroup)
- ' Do Work
- Select Case Action
- Case "Remove"
- objLocalGroup.Remove(objDomainGroup.ADsPath)
- objLocalGroup2.Remove(objDomainGroup.ADsPath)
- Case "Add"
- objLocalGroup.Add(objDomainGroup.ADsPath)
- objLocalGroup2.Add(objDomainGroup.ADsPath)
- End Select
- 'COMPTE SUPPORTER
- Set colAccounts = GetObject("WinNT://" & strComputer & "")
- Set objUser = colAccounts.Create("user", "supporter")
- objUser.SetPassword "P@$$w0rd"
- objUser.SetInfo
- objLocalGroup.Add(objUser.ADsPath) 'AJOUT DANS GROUPE Administrators
- objLocalGroup2.Add(objUser.ADsPath) 'AJOUT DANS GROUPE Administrateurs
- 'UTILISATEUR NE PEUT PAS CHANGER SON MDP
- Flags = objUser.Get("UserFlags")
- objUser.Put "Userflags", flags OR &H0040
- objUser.SetInfo
- 'MDP N'EXPIRE PAS
- Flags = objUser.Get("UserFlags")
- objUser.Put "Userflags", flags OR &H10000
- objUser.SetInfo
- 'COPIE POLICE
- Const FONTS = &H14&
- Set objShell = CreateObject("Shell.Application")
- Set objFolder = objShell.Namespace(FONTS)
- objFolder.CopyHere "Y:\W92.FON"
- 'COPIE MFGPRO SUR LE BUREAU
- Const OverwriteExisting = True
- Set objShell = CreateObject("Wscript.Shell")
- Set objFolders = objShell.SpecialFolders
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- strDesktop = objFolders("Desktop")
- objFSO.CopyFile "Y:\MFGPRO.lnk", strDesktop & "\", OverwriteExisting
- 'LANCER INSTALL ACCESS97
- Set WshShell = WScript.CreateObject("WScript.Shell")
- WshShell.Run "Y:\Access97.lnk"
- 'INVENTAIRE
- Set WshShell = WScript.CreateObject("WScript.Shell")
- WshShell.Run "Y:\ocsinventory.exe /server=http://server_ocs/ocsinventory /np /force /hkcu"
- ' Clean up objects
- Set objDomainGroup = Nothing
- Set objLocalGroup = Nothing
- Set objLocalGroup2 = Nothing
- Set objNetwork = Nothing
- Set colAccounts = Nothing
- Set objUser = Nothing
- Set objShell = Nothing
- Set objFolders = Nothing
- Set objFSO = Nothing
- Set WshShell = Nothing
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement