Config Identity

Set identity Application Pool value NetWorkService to LocalSystem.
Create a file AssignPool.vbs

Code:

dim newAppPool
  dim CreateNewAppPool
  set newAppPool = GetObject("IIS://localhost/w3svc/AppPools/Classic .NET AppPool")
  newAppPool.AppPoolIdentityType=0
  newAppPool.SetInfo
   if err = 0 then
      CreateNewAppPool = True
   else
      CreateNewAppPool = false
   end if

After Run file AssignPool.vbs

function AssignAppPoolBat() 
    STRING  szTitle, szMsg; 
    NUMBER  nvFileHandle;
    STRING szPathDir; 
    STRING para;
    STRING szFileNameBat,szParaPathWriteLine,szParaArgument;
begin 
     //CreateFileBat(INSTANCE_NAME,"AllowKeepAlive.bat","SET W3SVC/AllowKeepAlive false","Cscript.exe %SYSTEMDRIVE%\\Inetpub\\AdminScripts\\adsutil.vbs"); 
     //CreateFileBat(INSTANCE_NAME,"AllowKeepAlive1.bat","SET W3SVC/1/AllowKeepAlive false","Cscript.exe %SYSTEMDRIVE%\\Inetpub\\AdminScripts\\adsutil.vbs");
     szFileNameBat ="AssignAppPool.bat";
     szParaPathWriteLine="";
     szParaArgument="Cscript.exe"+" "+SUPPORTDIR ^ "\\AssginPool.vbs";
     
     szPathDir=WINDISK^"\\"; 
     OpenFileMode (FILE_MODE_APPEND); 
     if (CreateFile (nvFileHandle, szPathDir, szFileNameBat) < 0) then 
        MessageBox ("CreateFile failed.", SEVERE); 
        abort; 
     else 
    	para=szParaPathWriteLine;
        szParaArgument=szParaArgument+" "+ para;
        if (WriteLine(nvFileHandle, szParaArgument) < 0) then 
            MessageBox ("WriteLine failed.", SEVERE); 
        else 
        endif; 
     endif; 
     CloseFile (nvFileHandle);
     if LaunchAppAndWait (WINDISK^"\\"+szFileNameBat,"", WAIT)<0 then
		//MessageBox("StartService khong thanh cong" ,WARNING);
	 else                              
		//MessageBox("StartService thanh cong",WARNING); 
	 endif;
	 DeleteFile(WINDISK^"\\"+szFileNameBat);
end;

Result: set identity Application Pool have value NetWorkService to LocalSystem.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: