![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | PowerShell 1.0 & IIS6 & Virtual directory Hi, Does someone has some code sample on how to create a virtual directory in IIS 6 with PowerShell ? Also how can I test if a virtual directory already exists ? Thanks |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: PowerShell 1.0 & IIS6 & Virtual directory Hi Philippe, This creates a new virtual directory on the local iis with tha name of 'NewVDir'. To create the directory on a remote computer, Replace 'localhost' with a remote iis computer name. $iis=[adsi]"IIS://localhost/W3SVC/1/Root" $vd = $iis.psbase.children.Add("NewVDir","IISWebVirtualDir") $vd.put("Path","D:\AdminDB") $vd.psbase.CommitChanges() To check if a virtual directory already exists: $vdir = $iis.psbase.children | where {$_.AppRoot -eq '/LM/W3SVC/1/Root/NewVDir'} if($vdir) { 'already exists' } --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Directory Size using PowerShell | dm3281 | PowerShell | 8 | 08-01-2008 08:19 AM |
| How do I delete an OU in Active Directory from Powershell. | Johannes L | PowerShell | 3 | 05-19-2008 10:02 PM |
| Programs are suddenly unable to acces their (virtual) installation directory | Chillin' | General Discussion | 0 | 04-15-2008 07:09 PM |
| Powershell & Active Directory | orphan | PowerShell | 3 | 05-03-2007 04:33 AM |
| Active Directory support in PowerShell | bill | PowerShell | 1 | 01-11-2007 01:57 PM |