Search This Blog

Saturday, March 18, 2017

What is Azure VM maximum network throughput

Azure VM network throughput depends on the VM size, you can see them in Azure VM sizes documentation page.
Currently VMs have values of low, moderate, high, very high or extremely high.

Microsoft is promising that in April 2017, the will replace current values to actual numbers, so we will be able to see in Mbps or Gbps maximum VM bandwidth.

Wednesday, March 1, 2017

Get user password expiration date from Active Directory with Powershell

Here is a Powershell script I used to get following AD user information :

  1. When user will have to change his password (msDS-UserPasswordExpiryTimeComputed attribute)
  2. When user's password has been changed last time (passwordLastSet attribute)
  3. If Password Never Expires has been enabled for user
and then output information to CSV file:

Get-ADUser -filter * -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed", "passwordLastSet", "PasswordNeverExpires" |
Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}, PasswordLastSet, PasswordNeverExpires |
sort-object -property ExpiryDate |Export-Csv C:\Output\passwords.csv

Fix "The Trust relationship between this workstation and the primary domain failed" issue

If you logon to domain workstation, but get the "The Trust relationship between this workstation and the primary domain failed" error, then it usually means that computer domain account has different password than computer thinks, and you have to reset the computer account password.

To do this, you need to logon to computer with local account, run Powershell as admin and then execute this command:

Reset-ComputerMachinePassword -Server [DC-FQDN] -Credential [DOMAIN]\[USER]

Where DC-FQDN is name of reachable domain controller and DOMAIN\USER is user account which has permissions to reset computer account password.

Then reboot and you will be able to log on to domain.

Restore SQL database backup

If you are having trouble restoring SQL database from backup, try this SQL script (replace values in italic with your actual values)

RESTOREDATABASE db_name FROM DISK = 'db_backup_path'