Powershell: Change IIS Application Pool passwords via WMI

BACKGROUND: I'm writing a script to pull all PCs in an OU, Search each server for IIS Application Pools running under a spesified user, change the password on the app pool, reset IIS.
I'm able to grab the application pools on a server...
$tmp = $NULL
$tmp = Get-WMIObject -class IISApplicationPoolSetting -namespace "root\microsoftiisv2" -computer $Server -authentication 6
I can find the app pool(s) I need...
$PoolsThatMatch = @()
if ($tmp) { $PoolsThatMatch += $tmp | where {$_.WAMUserName -like "contoso\$ServiceName"}}
I can see all the information rigth there...
$PoolsThatMatch | Select __Server,name,WAMUserName,WAMUserPass
I can even change the password on the local object...
$PoolsThatMatch[0].Properties["WAMUserPass"].Value = "PowerShellRocks!"
What I can't figure out is how to push the value back to the server! Please help!

Hi.
First, msdn points out the following caution which should be considered before changing the password.
Changing the value of this property is not recommended. If you do, you must change the Windows account password to the identical value. You must also synchronize existing IIS out-of-process application identities, using Component Services to edit the user name and password values, which are found on the Identity tab of the property sheet for each package.
http://msdn.microsoft.com/en-us/library/ms525467.aspx
Secondly, using the Put() method should set the changes made:
$PoolsThatMatch[0].PsObject.Properties["WAMUserPass"].Value = "Password2"
$PoolsThatMatch[0].Put()
Regards
NiklasNiklas Goude
Blog: www.powershell.nu
Twitter: @Ngoude

Similar Messages

  • Where to change Application pool password?

    Hi,
    I want to change SharePoint Webapplication Application pool password.
    Could someone please help me , how to do so?
    Thanks.
    Badri

    Go to Central Administration -> Security -> Configure Service Accounts. Find your Web Application Application Pool from the dropdown, and you can select the Managed service account it runs under. You can also set up a new Managed Service Account here.
    Alternatively, if you need to set a Managed Service Account password, go to Configure Managed Accounts under the same section.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site

    How to fix:
    Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if
    the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

    Hi
    This is an issue with the permissions. Check this link
    http://www.spdoctor.net/Pages/message.aspx?name=Error-occurred-in-deployment-step-Recycle-IIS-Application-Pool
    http://stackoverflow.com/questions/7417046/vs2010-error-in-recycling-iis-application-pool-not-found
    Thanks
    Girish

  • "Recycle IIS Application Pool" error while deploying solution using Visual Studio

    Hi All,
    I am getting below error while deploying solution from Visual Studio. I have verified the URL and its okay and site is also up and running and accessible.
    Error 1 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site:
    http://portal/sites/site1/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since
    you created the project, update the Site URL property of the project.
    Suggest some solution.
    Thanks in advance. 

    Hi,
    Please  do/Validate the below things..
    1.Current logged  in user is in Administrator group
    of SharePoint server.
    2.Current logged user has db_owner permission for Content
    Database  of the site you are trying to deploy .
    http://www.sharemuch.com/2010/03/19/resolving-vs-2010-solution-deployment-issues-for-sharepoint-2010-projects/
    and also
    Do a IIS reset
    Check if IIS is resetting.
    If it is not, then disable UAC from control panel and IIS reset will work.
    Go to Central Administration site
    Navigate to the Manage Web Applications page
    Click on the web application that hosts the site you are trying to deploy to
    Click the User Policy ribbon item.
    Add your windows account to the list of users with the Full Control permission.
    Don't forget to mark it as an Answer if it resolves your issue and Vote Me as helpful if it useful.
    Mahesh

  • Error occurred in deployment step 'Recycle IIS Application Pool': Could not load file or assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specif

    Hi All,
    I am using Virtual box to connect to Sharepoint 2013 VPC. Due to an unexpected sutdown of my machine the VPC got some issue. Now I restored it using my bak up file. But after this when I deploy my sharepoint 2013 farm solution Iam getting the following error.
    Error occurred in deployment step 'Recycle IIS Application Pool': Could not load file or assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified..
    Editing the web.config and adding dependentAssembly didnt worked for me.
    What could be the issue? Any suggestions ?
    Thanks in advance...
    Regards
    Nimisha
    [email protected]

    Hi,
    Please try to do as follows:
    1. Check your farm solution whether reference the Microsoft.SharePoint.dll. Or try to add the Microsoft.SharePoint.dll into the bin folder.
    2. Execute the iisreset command.
    3. Create a new farm solution and check whether the issue still occurs or not.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Error occurred in deployment step 'Recycle IIS Application Pool'

    Currently i’m working on a development machine for SharePoint 2010. Even the development machine is setup with multiple accounts as security describes. Therefore sometimes you run into strange (security) error messages. The following error message
    occured when i tried to deploy a SharePoint project from Visual Studio 2010.
    Error occurred in deployment step ‘Recycle IIS Application Pool’:
    <nativehr>0×80070005</nativehr><nativestack></nativestack>Access denied
    It seems that the account under which your Visual Studio 2010 is running needs to have sufficient rights on the web application to which you are deploying your solution. In my case this was easily fixed by putting my domain account in the site collection
    administrators list for that specific web application.

    Hi vishal,
    The root cause of the issue is
    You don't have IIS restart privilege on windows OS
    Even if you have it, you have not added your login account in to SharePoint sitecollection administrator.
    To solve the issue
    To see whether you have privilege or not, you can open a command prompt and type "IISReset". 
    If you able to restart, then it will restart successfully otherwise it will deny it.  The reason is, Though you are in administrators group, windows 2008 will not run on the administrator privilege. Every time when you do an operation like IIS
    restart or Installation, it will prompt for UAC (User Account Control). You should accept the dialog box and elevate the privilege to run the operation. 
    Or you can right click the application whatever you want to run and click the menu option "Run as Administrator" which will solve the issue.
    If you want to avoid UAC and directly run through you admin account then, go to Control panel -> Manage account -> Hide UAC
    Second if you have all the privilege and still you are getting error in VS2010 as "'Recycle IIS Application Pool':0x80070005Access denied, then you have to add your account in to site collection admin.
    1) You can do this by going to sharepoint administration page.
    2) Navigate to the site collection administration option
    3) Add your name into site collection administrator as a second owner. SharePoint will allow a second owner for site colleciton
    For more informaion, please refer to:
    http://blogs.msdn.com/b/suresh/archive/2011/01/01/recycle-iis-application-pool-0x80070005-access-denied-deploying-sharepoint-solution-iis-restart-issue.aspx
    Thanks,
    Simon

  • Error occurred in deployment step Recycle IIS Application Pool - migration 2010 to 2013

    Hello
    When I upgraded my solution from 2010 to 2013 and tried to deploy got the following error
    Error occurred in deployment step 'Recycle IIS Application Pool'
    Any idea ?
    Thanks
    Momo

    Hi  Momo,
    Thank you very much for sharing your solution here. It  would be helpful for others who encounter similar issue.
    Thanks again,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Eric Tao
    TechNet Community Support

  • Recycling IIS Application Pool when processor load reaches a certain %

    Hi Team
    I need to create a recycle event when the IIS server processor load reaches about 90%, it would then need to recycle the IIS Applications Pool,
    Any advice would be greatly appreciated, thanks

    In addition to this, i know that this can be done by IIS but my boss wants it to be logged and managed by SCOM, thanks

  • NLB Web Front End (WFEs)servers & Clustering IIS Application Pool between the two WFEs

    Hi All,
    I have just encountered a very bad experience in my Production environment.My topology is as follows: NLB WFEs, MOSS APP server, Cluster DBs, DCs.
    NLB on the WFEs is working fine. However, for some unknown reason, one of my site under the Application Pool in IIS Manager was stopped on one of the WFE and the site was down. NLB did not redirect request to the second WFE server.
    My question is: How can I make sites under the Application Pool highly available? If any site is in a stopped state, there should be a mechanism in place to redirect request to the Application Pool on the second NLB WFE.
    Kindly help and advise.
    Thanks all.

    Hi Noah,
    The best way of knowing whether the Application pool is down is to monitor it.
    Using appcmd, i can check the state of an application under the application pool.
    I want to create a schedule task which will check the status of the application pool and in case the application pool is stopped, to send me an email as alerts.
    Using Powershell and appcmd, can you guide me on how to do the above i.e I want to use Powershell with appcmd to check for availability of an application pool. If the status is stopped, send me an email as alert.
    Thanks.

  • Changed SP application pool service account - 500 internal server error

    Hi all, 
    Trying to resolve some farm installation issues in our test environment. Long story short is that on install a previous user used our SP_Farm account to install everything and pretty much use this account to run all web applications/services.
    So I am in the process of trying to resolve one portion of it by allocating a new managed account for the web application pools. I have created a new account called SP_Pool on the DC. This is just a domain user with no specific rights applied (classic authentication).
    I changed the account using CA "configure service accounts" for both our mysite and SharePoint site web apps. 
    SP applied the new SP_Pool to the appropriate workstation groups and DB rights. Tried to hit the site and got the rather generic HTTP 500 Internal Server error. Put SP_Pool into the local admin rights group to test and was able to hit the site so something
    is definitely pointing to a rights/permission issue. I was under the impression the app pool accounts did not require any local SP server rights? I have seen mention of "Impersonate a client after authentication" but that's only for Claims based
    auth
    I've gone through every scenario which are mentioned below:
    Tried to connect from a client machine and server. 500 error
    All App pools are started and SP_Pool is running both web apps
    IIS bindings are same as before
    no changes to the web.config
    No errors in the Application event viewer
    Checked iis logs and has 500 errors throughout it. The 4th number in the sequence usually changes (i.e. 500 0 0 499, 500 0 0 468 etc)
    Turned on Failed Request Tracing and no issue has come up
    Tried to clear the configuration cache - same deal
    Ran process mon - seen nothing out of the ordinary
    So based off the above is there anywhere else I could look to try and resolve this issue? Or is there something so damn obvious I've missed here? Running out of ideas
    Appreciate any feedback
    Thanks

    Hello,
    Have you tried to turn your SharePoint server off and on again ( I know , it sounds like a basic helpdesk answer but in the case of changing user account for application pool, it already fixed the issue for me)
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

  • How to change a users login password via single user mode, plus multiple issues?

    So, there is much to this Thread.
    (First Issue)
    A lil back ground, i'm working on a MacBook Pro 3,1 running OS X Tiger 10.4.(something, no idea), the The user has forgotten their account password. Now before you tell me to just change it through the Root Admin account, that account seems to have its own issues, the accounts do not show up in the system preferences, therefore not allowing me to change that users account password.
    (Second Issue)
    Once I'm able to login into the users account, is there any way to disable / erase / eradicate the key chain system?
    (Third Issue)
    All of a sudden the MacBook has lost all audio capability, both in the built in speakers and through the headphone jack.
    i'm open to any ideas, its currently 10:14am the user is wanting this to be done by 2:45pm please help i'm desperate and i don't want to be defeated by a Mac

    It's possible some of these things are related. I'd first do a basic verification of the computer's system.
    First, if at all possible make a backup of the drive in its present configuration. If something goes wrong during repair attempts and makes things worse you will have a backup. You will have to decide how to work this in the light of any present backups you may have, for example, a backup that may be a few days out of date. In that case you may want to keep that one and make a second backup of this as they are now, though I realize people often don't have a lot of empty drives sitting around.
    Boot from the System installer disc that came with your computer or is the one for the version you currently have on there, select language if applicable, choose utilities, run Disk Utility and verify (and repair if necessary) the drive. You can verify a drive from DU on your main drive while booted but I have found this can result in incorrect reporting of errors. To repair your drive you have to run it from a drive other than the boot drive anyway.
    Next, boot from your drive in [Safe Mode|http://docs.info.apple.com/article.html?artnum=107393] and repair permissions. You can repair permissions while booted from the installer disc but this uses the permissions configuration on the installer disc which may be out of date if you have run any updates on your computer. Booting your computer to Safe Mode restricts the number of things running on your computer while permissions are being run and does a bit of spring cleaning at the same time.
    [Resolve startup issues and perform disk maintenance with Disk Utility and fsck|http://docs.info.apple.com/article.html?artnum=106214]
    [Using Disk Utility in Mac OS X 10.4.3 or later|http://docs.info.apple.com/article.html?artnum=302672]
    [Disk Utility's Repair Disk Permissions|http://docs.info.apple.com/article.html?artnum=25751]
    From BDaqua (couldn't have said it better):
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer (Edit: Do not use this disc if it is not the same general version as what you have currently on your computer, e.g. use a Tiger disc for a Tiger drive, not a Panther disc), then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk.
    Then Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes."

  • Removing Supervisor Password via WMI?

    Hello guys, I'm trying to remove our supervisor password from our computers using the WMI-interface (described here: http://support.lenovo.com/en_US/detail.page?LegacyDocID=MIGR-68488). It works fine when trying to change the password using the provided script, but the syntax doesn't allow me to enter "nothing" as a password. Is there some way I can disable the supervisor password-option using WMI? I noticed that there's a vbs-script for loading default settings included in the package but that doesn't work with a password protected BIOS. Any tips or ideas? Thanks in advance,Johan   

    Attached is a script to do what you request.  I made this by modifying SetSupervisorPassword.vbs (which is inside the zip file at the URL you linked) to change the current password to <blank> which disables the supervisor password feature.
    You can compare SetSupervisorPassword.vbs to this new script to see exactly what I did.
    Hope this helps.
    PS - loading default settings doesn't reset or disable BIOS passwords.

  • Error occurred in deployment step 'Recycle IIS Application Pool': Object reference is not set to an instance of a object.

    Hello, 
    When I do a deploy from VS2012 I get the error above. 
    Specifications: 
    - User is Farm Admin
    - User is Site Collection Admin
    - User is added with full control to the Web application user policy
    - User is db_owner of the content db, config db, admin content db
    - User Access Control is disabled
    - User is Local administrator
    - User is a member of WSS_ADMIN_WPG
    - host name is added to the host file.
    Somebody has a solution?

    almost you have everything, did you try to close the visual studio and start "Run as administrator". if not do it and try to redeploy.
    I would also check if the Sharepoint Timer Services and Sharepoint administration Services running on all sharepoint server(via services console.)
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Changing an Admin's account password via ARD

    Greetings!
    I came across this posting on changing a user accounts password via ARD:
    http://discussions.apple.com/thread.jspa?messageID=2130579&#2130579
    I tried Vespazzo Unix command in this thread:
    passwd (name of user)
    (new password)
    (new password)
    as root, but in the "Send Unix Command" history window that pops up, next to each computer name under the "Status" column, all I see is a green check symbol with the words, "Changing Password for (account name)", and that's it. It won't go any further then that. Almost like it's hung on something. And I'm not seeing any progress bar indicating something is happening or is about to happen?!?
    Am I missing something?
    Any help would be greatly appreciated!
    MM
    G5/2.5   Mac OS X (10.4.7)  

    Not sure what's going on with this, but I let ARD sit for about an hour or so, until I finally decided that this wasn't doing anything. I restarted my Mac and logged back in. Opened ARD and controlled into one of our design workstations as the admin, the password we usually use, didn't work! The new one did! I tried a couple of others and those worked too with the new password! So who knows what the problem with ARD was.
    As long as the command worked, it's fine by me!
    Thanks anyway...
    MM

  • Change Password via telnet session

    Hi,
    I would like to know how to change the tacacs enable password via telnet session.
    When a new user login the first time via telnet, tacacs prompts the user with changing login password. However, it never prompts to change the enable password. Please advice.

    I am not clear what your problem is. TACACS uses a single password for a user and does not distinguish an enable password which is different from the login password. TACACS will grant access to enable based on what is set up in the user profile (or group profile) not on having a separate password. The difference between a login password and the enable password is used by the router locally when the router is not able to communicate with the TACACS server.
    So when TACACS prompts a new user to change the initial setup password, that is all that TACACS needs to do.
    HTH
    Rick

Maybe you are looking for