Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CreateNewUser() {
- var container = GetObject("WinNT://" + _wshNet.ComputerName);
- var account = container.Create("user", _userName);
- account.SetPassword(_password);
- account.SetInfo();
- }
- function AddUserToIIS_WPG() {
- var iisWPG = GetObject("WinNT://" +
- _wshNet.ComputerName + "/IIS_WPG,group");
- var account = GetObject("WinNT://" +
- _wshNet.ComputerName + "/" + _userName + ",user");
- if (!(iisWPG.IsMember(account.AdsPath))) {
- iisWPG.Add(account.AdsPath);
- }
- }
- function SetFolderPerms(user, folder, parms, ACCESS_FLAG) {
- var oExec = _oShell.Exec("cacls \"" + folder + "\" " +
- parms + " " + user + ":" + ACCESS_FLAG);
- var oResponse = oExec.StdOut;
- while(oExec.Status == 0) {
- Sleep(100);
- }
- while(!oResponse.AtEndOfStream) {
- var sLine = oResponse.ReadLine();
- if (sLine.indexOf("processed") > -1) {
- return true;
- }
- else {
- return false;
- }
- }
- }
- function CreateAppPool() {
- var appPoolRoot = GetObject("IIS://localhost/w3svc/AppPools");
- var newAppPool =
- appPoolRoot.Create("IIsApplicationPool", _appPoolName);
- newAppPool.WamUserName = _userName;
- newAppPool.WamUserPass = _password;
- newAppPool.LogonMethod = 1;
- newAppPool.AppPoolIdentityType = 3;
- newAppPool.SetInfo();
- }
- function CreateVirtualDirectory() {
- var oRoot = GetObject(_iisRoot);
- var oVirDir = oRoot.Create("IIsWebVirtualDir", _vdirName);
- oVirDir.AccessRead = true;
- oVirDir.AccessScript = true;
- oVirDir.AccessExecute = true;
- oVirDir.DefaultDoc = "default.aspx";
- oVirDir.Put("Path", _vdirPhysicalPath);
- oVirDir.SetInfo();
- oVirDir.AppCreate(true);
- oVirDir.SetInfo();
- }
- function AssignAppPool() {
- var oVirDir = GetObject(_iisRoot + "/" + _vdirName);
- oVirDir.AppPoolId = _appPoolName;
- oVirDir.SetInfo();
- }
- function SetDefaultNetFX() {
- var sys = _oShell.ExpandEnvironmentStrings("%windir%");
- var fx = _oFso.BuildPath(sys, "Microsoft.NET\\Framework\\v2.0.50727");
- var regiis = _oFso.BuildPath(fx, "aspnet_regiis.exe");
- _oShell.Run(regiis + " -sn W3SVC/1/Root/\"" + _vdirName + "\"", 0, true);
- }
- function RestartIIS() {
- _oShell.Run("iisreset /restart", 0, true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement