Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7918165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:24:50+00:00 2026-06-03T15:24:50+00:00

Ive got a script for stopping a site: param($HostName = localhost, $SiteName) $server =

  • 0

Ive got a script for stopping a site:

param($HostName = "localhost", $SiteName)

$server = $HostName
$siteName = $SiteName
$iis = [ADSI]"IIS://$server/W3SVC"
$site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.ServerComment -eq $siteName}
$site.start()

# SIG # Begin signature block ...

But when i run the script on a server with high security policies i get this error:

The following exception was thrown when trying to enumerate the collection: "Unknown error (0x80005000)".
At D:\DeploymentScripts\Common\StopSite.ps1:6 char:8
+ $site = <<<<  $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.ServerComment -eq $siteName}
    + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
    + FullyQualifiedErrorId : ExceptionInGetEnumerator

From what I have read this might occur if i don’t have access to the IIS , but im running the script as admin, should that not grant me the access i need ?

Does the webadministration module give more access rights ?
I don’t import this since i didn’t have to do this on the other servers, if i need to import the webadministration there is another problem, when i try i get a error saying the WebAdministrationAliases.ps1 is not digitally signed…

I have tested the script on other servers with no problem, but this one got more strict policies as mentioned above, and its not a option to change the policies.

Im running this on a Windows server 2008 R2, with IIS 7.5.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:24:58+00:00Added an answer on June 3, 2026 at 3:24 pm
    Import-Module WebAdministration
    Stop-WebSite 'Default Web Site'
    Start-WebSite 'Default Web Site'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im really really new to Javascript but Ive got this script that loads the
Ive got a VBS Script that,generates an url to download a file from a
Ive got this current situation with an auction site. trada.net Somtimes they go offline
Ive got CC.Net and NAnt (and MSBuild) running on a new VM-based build server
I've got a script that pulls text from a Web server. I want to
ive got this script that echos the information from a mysql database. now it
Ive got this register script that puts the information into a mysql database. now
Ive got this script: $(function(){ $(.submenu li:even).addClass(oddrow); }); It works great - but it
Ive got a simple Nunit runner for a rake script i have: module NUnitRunner
I've got a script that connects to SQL server to pull some data over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.