Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Powershell IIS plugin - cmdlets not working


  • Please log in to reply
4 replies to this topic

#1 Jeffmikers

Jeffmikers

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:03:34 AM

Posted 10 March 2015 - 09:34 AM

Hey everyone. I'm pretty much a novice at Powershell so bear with my noobness. I'm specficially trying to run the "Get-Webbinding" cmdlet (which I have successfully run on some of my other servers)

 

Windows Server 2008 R2 Standard:

 

Get-PsProvider

-showed the WebAdministration module is not loaded

 

Import-Module WebAdministration

-error occurs. "Cannot be loaded because the execution of scripts is disabled....."

 

Get-ExecutionPolicy

-Output is "restricted"

 

Set-ExecutionPolicy RemoteSigned

-confirmed with a Yes.

 

Import-Module WebAdministration

-error occurs. "...skipped because it's already present"

 

Get-PsProvider

-Shows that WebAdministration is now installed

 

Get-WebBinding (the cmdlet I really want to run)

-error. "not found"

 

 

 

Any ideas why this cmdlet won't run?

 

 

 



BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:01:34 AM

Posted 10 March 2015 - 11:47 AM

No idea; sorry :( If you don't get an answer here you may get one on ServerFault.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 SleepyDude

SleepyDude

  • Malware Response Team
  • 2,995 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Portugal
  • Local time:09:34 AM

Posted 10 March 2015 - 03:07 PM

Hi,

 

Can you run other powershell scripts?

 

I don't have a big experience with powershell but in my notes I have this: set-executionpolicy RemoteSigned -Force to enable script execution

 

Sometimes we have to force the module to reload using: Import-Module WebAdministration -force

 

Hope this helps.


• Please do not PM me asking for support. Post on the forums instead it will increases the chances of getting help for your problem by one of us.
• Posts in the Malware section that are not replied to within 4 days will be closed. PM me or a moderator to reactivate.
• Please post your final results, good or bad. We like to know! Thank you!

 
Proud graduate of GeekU and member of UNITE
___
Rui

 
 


#4 Jeffmikers

Jeffmikers
  • Topic Starter

  • Members
  • 10 posts
  • OFFLINE
  •  
  • Local time:03:34 AM

Posted 10 March 2015 - 07:23 PM

Thanks for the reply, SleepyDude. Gave it a whirl and it's the same results. It keeps indicating the module is already "present". I assume that's the same thing as "installed".

 

The path of the iisprovider says "v1.0", but this is Powershell 2.0. Is this relevant information?

 

 

 

Import-Module : The following error occurred while loading the extended type data file:
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\WebAdministration\iisprovider.types.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\webadministration\iisprovider.types.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\webadministration\iisprovider.types.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
At line:1 char:14
+ import-module <<<<  webadministration -force
    + CategoryInfo          : InvalidOperation: (: ) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand


Edited by Jeffmikers, 10 March 2015 - 07:23 PM.


#5 SleepyDude

SleepyDude

  • Malware Response Team
  • 2,995 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Portugal
  • Local time:09:34 AM

Posted 11 March 2015 - 04:33 AM

Hi,

 

I tested the commands in one of the servers at my work and it works just fine!

 

Did some searching and it seems the webadministration module works only if you have IIS 7.5 installed.


• Please do not PM me asking for support. Post on the forums instead it will increases the chances of getting help for your problem by one of us.
• Posts in the Malware section that are not replied to within 4 days will be closed. PM me or a moderator to reactivate.
• Please post your final results, good or bad. We like to know! Thank you!

 
Proud graduate of GeekU and member of UNITE
___
Rui

 
 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users