Welcome to Powergui.org - an open source community for Windows Powershell

PowerGUI.org PowerGUI.org and blogs

Forums » Request a Script

Thread: Modify Logs Folder in IIS 6

This question is answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 2 - Pages: 1 - Last Post: Nov 26, 2009 6:45 AM by: luigilink
luigilink


Posts: 3
Registered: 11/26/09
Modify Logs Folder in IIS 6
Posted: Nov 26, 2009 5:58 AM
 
  Click to reply to this thread Reply

Hi everyone,

OS : Windows 2003 X64
IIS : Version 6.0
Powershell : 1.0

Is somebody help me for changing the path folder logs in IIS 6 ?

I try this but anything changes:

$iis = [ADSI]"IIS://localhost/W3SVC"
$iis.LogFileDirectory.Value = "D:\logsiis\"


Thank You

JC


Shay Levy


Posts: 1,919
Registered: 1/31/08
Re: Modify Logs Folder in IIS 6
Posted: Nov 26, 2009 6:42 AM   in response to: luigilink
 
  Click to reply to this thread Reply

This will update the logs folder for "Default Web Site" (index 1)

$server = "IISServerName"
$logDir = "c:\iisLogs"

$iis = [ADSI]"IIS://$server/w3svc/1"
$iis.LogFileDirectory = $logDir
$iis.setInfo()

Shay Levy [MVP]
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar
luigilink


Posts: 3
Registered: 11/26/09
Re: Modify Logs Folder in IIS 6
Posted: Nov 26, 2009 6:45 AM   in response to: Shay Levy
 
  Click to reply to this thread Reply

Yes it works with setinfo()

Thank you so much !


Legend
MVP: 2501 + pts
Guru: 2001 - 2500 pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums