Powershell and WebAdministration module - VisualCron - Forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Orchestr8
13 years ago
Hi,

I'm trying to run a task with a powershell script that interogates IIS to find the physical path of a virtual directory and write it to a file. When I run the script directly in powershell or right click on it and select "Run with powershell" the script runs correctly. However when I run the same script from within Visualcron, I get an error in the step with code 77777 and a stderr output of
"Exception in Task: Cannot find a provider with the name 'WebAdministration'. Cannot find a provider with the name 'WebAdministration'."

what can I do to fix this? the machine is a windows web server 2008 r2 (64 bit)

the powershell is very simple and contains the following


Import-Module WebAdministration
if (test-path c:\WebsiteLocations\CurrentUATOper8.loc)
{
Remove-Item c:\WebsiteLocations\CurrentUATOper8.loc
}
$CurrentUAT = (Get-WebFilePath "IIS:\Sites\UAT\Oper8").Name

New-Item -Path c:\WebsiteLocations -name CurrentUATOper8.loc -type "file" -value $CurrentUAT
Sponsor
Forum information
Support
13 years ago
I am not a PowerShell expert but from what I have read this is a permissions problem. Try running this with a Credential.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top