Tag: password

netsh wireless password

Show Wireless Network Password on Windows 10

Today I have a simple blog post, which is more less just a note for myself. If you are join your Windows 10 device to a Wireless Network and you can’t remember the Wireless Password or Key you can recover this using the netsh command. Simply run this command to show the network key of the wireless network:

 
netsh WLAN show profile name="WirelessNetwork" key=clear

To list the wireless networks you have access to, you can use the following command:

 
netsh WLAN show profiles


Import MSOnline PowerShell Module

Change Office 365 password expiration policy

Well if you are using Office 365 and you may have the need to change the password expiration policy for some accounts. (Important: This is not recommended, in my opinion password changes are even more important when using cloud services.)

To change the password expiration policy for an user on Office 365 you have to to this with Windows PowerShell.

To manage Windows Azure Active Directory with PowerShell, where also your Office 365 users are stored, you have to do some simple steps.

First make sure you have installed the .NET Framework 3.5 on your management machine.

<br />
Enable-WindowsOptionalFeature -FeatureName NetFx3<br />

Install Microsoft Online Services Sign-in Assistant: Install the appropriate version of the Microsoft Online Services Sign-in Assistant for your operating system from the Microsoft Download Center. Microsoft Online Services Sign-In Assistant for IT Professionals RTW.

Install Windows Azure AD Module for Windows PowerShell: Install the appropriate version of the Windows Azure AD Module for Windows PowerShell for your operating system from the Microsoft Download Center:

Import the MSOnline Windows PowerShell module

<br />
Import-Module MSOnline<br />

Import MSOnline PowerShell Module

Connect to your Windows Azure Active Directory Tenant or your Office 365 Tenant:

<br />
Connect-MsolService<br />

This will open a popup windows where you have to enter your credentials.

Now now you can start working with your Windows Azure Active Directory.

Connect Windows Azure AD via PowerShell

And you can now finally change the password expiration policy to never.

<br />
PS C:\Users\Thomas\Desktop&gt; Get-MsolUser -UserPrincipalName user@domain.com | Set-MsolUser -PasswordNeverExpires $true<br />


Change Office 365 password expiration policy

office365

The default password expiration policy of Office 365 is set to 90 days. That means that users have to change their password every 90 days. I think basicly this is a good and secure policy but maybe your company has other security policy or for some other reason you have to deactivate this. We can change this setting through PowerShell with the MicrosoftOnline PowerShell Module.

  1. First connect to Office 365 via PowerShell more on this here
  2. Now you can use the following cmdlet
    Set-MsolUser -UserPrincipalName user@contoso.com –PasswordNeverExpires $true

 



How to download files with Powershell

Powershell HeaderThis should show you how you can download a file with Powershell. This is not a script or function you should use. It just is the the easyiest way to download a file with Powershell. If I have enough time I will create a function for downloading files.

$Url = "https://www.thomasmaurer.ch/ps.txt"
$Path = "C:\temp\ps.txt"
$Username = ""
$Password = ""
 
$WebClient = New-Object System.Net.WebClient
$WebClient.Credentials = New-Object System.Net.Networkcredential($Username, $Password)
$WebClient.DownloadFile( $url, $path )



How can I check the password of the IUSR and IWAM local accounts

After a late night session doing some work on a new webserver, I found a really important blog post (windowsitpro.com) for IIS administrators. The blog post shows how you get the password of the IUSR and the IWAM local accounts form the metabase.

Normally the IUSR and IWAM password are set automatically and unknown. But if you import the metabase on another you have to change the passwords of these two users (IUSR_<local machine name> and IWAM_<local machine name>).

  • First you have to update the adsutil.vbs script (localdiskdrive:\Inetpub\AdminScripts). You have to replace all the “”IsSecureProperty = True” with “”IsSecureProperty = False” otherwise the command would not show the real password.
  • Now you can run the following commands to get the password of these users

Get the IUSR password:

C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/anonymoususerpass

return:

anonymoususerpass : (STRING) "password"

Get the IWAM password:

C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/wamuserpass

return:

wamuserpass : (STRING) "password"

  • you also can set the passwords for those accounts in the metabase

Set the IUSR password:

C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/anonymoususerpass "password"

Set the IWAM password:

C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/wamuserpass "password"

  • after you change the passwords, you should sync the password from IIS with Microsoft Transaction Server (MTS) and component services with the following command

sync MTS:

C:\Inetpub\AdminScripts>cscript.exe synciwam.vbs -v

Thanks to John Savill