Posts

SOLVED: Get the "connect as" credentials for an IIS web application using the "WebAdministration" PowerShell cmdlets Get-WebApplication

When using the WebAdministration PowerShell cmdlets Get-WebVirtualDirectory the username, password and other virtual directory information as expected. However when using the Get-WebApplication cmdlet these properties aren't available even though a web application is a virtual directory. If you look at the applicationHost.config file you'll see that the application in fact has a virtual directory (with path "/") associated with it.  This virtual directory has the additional information required. <application path="/TestApp" applicationPool="TestSite">    <virtualDirectory path="/" physicalPath="C:\TestApp" userName="administrator" password="[enc:AesProvider:B2sdfsd1213E98dV53cb5NfdZndNWvCUf/AekXE=:enc]" /> </application> To access this information get the "/" virtual directory from the collection property. $app = Get-WebApplication "TestApp" ; $app . Collection [ 0

SOLVED: The Get-IISAppPool PowerShell cmdlet returns the application pool password encrypted starting [enc:IISWASOnlyCngProvider

When you run the  Get-IISAppPool PowerShell cmdlet and try and view the password of the application pool you may see that the password looks like this: [enc:IISWASOnlyCngProvider:uQaGVt5rssdfPO129+N0iAJs3iE0d46qeDy34lnYeOvoMWrts9t+cwY7BgtBnYO+IINgGaPiz+19820knjdaf81ndafjsdfyHzmaF3Cgqg=:enc] To resolve the issue and view the plain text password simply right click the PowerShell console and select Run as Administrator .  When running as administrator the following command will display the application pool's password in plain text. (Get-IISAppPool -Name " name ").ProcessModel.Password

SOLVED: The IISAdministration cmdlets don't reflect changes made to a Microsoft IIS Server configuration

You might find that when you're running the IISAdministration cmdlets such as Get-IISAppPool that the cmdlets return out of date information that doesn't reflect the current configuration settings. To resolve the issue you need to run the Reset-IISServerManager to re-load the latest configuration. Reset-IISServerManager -Confirm:$false

SOLVED: Find web sites and applications using a Microsoft IIS server application pool using the IISAdministration PowerShell cmdlets

If you're using the IISAdministration PowerShell module you may want to find out what applications are in use by an application pool. (if you're using the older WebAdministration module I've written the solution here ). # Gets the names of the applications in the specified application pool. Function Get-ApplicationPoolApplicationNames {     [ CmdletBinding () ]      param (         [ Parameter () ]           [ System.Object ] $ApplicationPoolName      )      process      {         $applicationNames = New-Object System.Collections.Generic.List``1[System.String] ;           $webSites = Get-IISSite ;           foreach ( $webSite in $webSites )           {                     foreach ( $application in $webSite . Applications)                {                     if ( $application . ApplicationPoolName -eq $ApplicationPoolName )                     {                          if ( $application . Path -eq "/" )                          {               

SOLVED: Find web sites and applications using a Microsoft IIS server application pool using the WebAdministration PowerShell cmdlets

Image
If you're using the older WebAdministration PowerShell module for IIS you'll notice when browing application pools you'll see the applications in the pool. https://learn.microsoft.com/powershell/module/webadministration However when you try and get the applications property it's not there because it's provided as a formatted property. You can grab the code from inside the formatter however there is a simpler method by enumerating the web sites and applications - these can be returned in the format SiteName or SiteName\ApplicationName # Gets the names of the applications in the specified application pool. Function Get-ApplicationPoolApplicationNames {      [ CmdletBinding () ]      param (         [ Parameter () ]           [ System.Object ] $ApplicationPoolName     )      process      {           $applicationNames = New-Object System.Collections.Generic.List``1[System.String] ;           $webSites = Get-Website ;           foreach ( $webSite in $webSi

SOLVED: Remote access doensn't work on TeamViewer Quick Support (TeamViewQS) when the remote computer runs an application in UAC

Image
You may find that remote access doensn't work on TeamViewer Quick Support (TeamViewQS) when the remote computer runs an application in UAC. The remote user will see a UAC prompt: While the user interacts with the UAC prompt you see the following dialog: When the action is complete you are returned to the desktop however you now can't control any application on the desktop. To resolve this issue ask the user to disconnect from TeamViewer and restart the TeamViewerQS.exe as Administrator and reconnect. While you're here why not check out our Server Documentation Tool , XIA Configuration Server ?

SOLVED: Microsoft PowerShell cmdlet Get-DnsServerRootHint shows error No root hint found by {server} name server on {servername} server

Image
When you run the Microsoft PowerShell cmdlet Get-DnsServerRootHint you see the error  No root hint found by {server} name server on {servername} server When you view the root hints in the DNS server manager MMC you see the root hint listed as "Unknown". If the DNS server is Active Directory Integrated this could be because the record is corrupt. You can view the raw data using ADSIEdit.msc and going to the following (replacing the distinguished name of the domain as required). DC=RootDNSServers,CN=MicrosoftDNS,DC=DomainDnsZones,DC= demo2019 ,DC= int Check the dnsRecord value if this value is missing or corrupt it will display the error above. If the DNS server is not Active Directory integrated then an error may be found in the cache.dns file found by default in the following location: C:\Windows\System32\dns\cache.dns The correct value can be set by clicking the "Edit" button in the DNS manager MMC and entering the correct value, or by clicking "Remove"