Windows 10 in Azure

I came across a great post that answers a question I had;  “How can I run a Windows 10 VM in Azure?”.  Now, this isn’t a normal thing, but for me and testing things, sometimes it’s nice to have a clean workstation that is domain joined in my Azure network. This is not a cheap alternative to running it as a day-to-day used VM, but more for folks like me who want to run tests in a lab scenario. Josh Heffner’s blog post does a great job of explaining the technical ‘how-to’ of this.

How To Upload and Run a Windows 10 Enterprise VM in Azure

By | January 20, 2015

Running a workstation OS in the cloud may not be the most practical solution at this time, but it may prove useful in some test lab scenarios. While Azure does support plenty of server OS options that you can choose from a gallery and have up and running within minutes, Windows 7 and 8 images are currently only available to MSDN Subscribers. Azure does provide the capability to upload your own VHD to run on their platform, though. In this guide, we will create a Hyper-V VM with Windows 10 Enterprise Preview, prepare the VHD and upload it to Windows Azure, and connect to the Windows VM for use in the cloud. We will be using Windows 10 in this guide, but the steps are the same for Enterprise versions of Windows 7 and Windows 8.

Read More about this at Josh’s page…

SHA-2 Certificates in AD FS 3.0

So I’ve come across this a couple of times and I’m sure it will begin to be more visible in the near future.  A big shout-out to  who posted this information -THANK YOU!

AD FS on Windows Server 2012 R2 (often referred to as “AD FS 3.0”) no longer has a dependency on IIS. One of the common methods used to generate a “Certificate Signing Request” (CSR) is to use IIS on the server you need the certificate on or by using another IIS server in the organization. Without access to IIS, your options for generating the CSR are to use the MMC snap-in, one of the native command line utilities or some third-party tools.

Continue reading

.NET 3.5 on Windows 10

I can’t tell how many times I have been burned when trying to simply enable .NET Framework 3.5.1 (and all the sub-goodies that so many programs need).  Lately, my struggle has been with Windows 10 or Server 2012 (& R2). I’ve found that installation files are usually not on an image I’m working with and there-in lies the problem. The next piece that throws me off is the lack of CD or DVD resources. Simply downloading .net only gives you the installer file, which does not work.

so first, get the files needed (\sources\sxs\microsoft-windows-netfx3-ondemand-package.cab)

Copy those files to a USB thumb drive (or capture an image)

Then from an elevated command prompt, run:

Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess

replacing D: with the appropriate drive letter, of course

Windows 10 Apps

So, I’ve run into some problems with the Groove music app built into Windows 10 (as soon as it starts, it closes). After looking through numerous posts on the issue, I came across a nice one on uninstalling some of the built-in apps on Windows 10 -through PowerShell, of course 😉

Always nice to know these things, right?

http://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-apps-and-how-to-reinstall-them/

 

PowerShell for Office 365

Got an awesome share today (in Yammer)

Welcome!

Are you an Office 365 IT administrator who is new to PowerShell? Are you looking for an Office 365 admin tool to automate repetitive administrative tasks? Or perhaps you are looking to access additional capabilities that aren’t available in the Office 365 Admin Center? Then PowerShell for Office 365 is for you

Continue Reading…

Customized PowerShell Startup

If you’re like me and use Windows PowerShell frequently, it might be worth looking at customizing your default PowerShell profile.  There are times where I may need to look back at previous scripts I’ve run -even long after the Shell window has closed. That is why I use the Transcript function. This feature logs all of the activity in every PowerShell session. Since I have it using the -append switch, I’ve modified the script to help separate sessions within the log. Within your C:\Users\”username”\Documents folder, create another folder called “WindowsPowerShell”. Within there, create a .ps1 file named, “Microsoft.PowerShell_profile.ps1”.

My preferences are for a Black window with classic green characters.  I also like to start off in my C:\Scripts folder. Lastly, I like my PowerShell logging to go into C:\PSlogging.

With that information, the .ps1 script will contain:

#Set Color Scheme
$Host.UI.RawUI.BackgroundColor = “Black”
$Host.UI.RawUI.ForegroundColor = “Green”
#Set Default Location
Set-Location C:\Scripts
#Set Logging Variables
$LogTime = Get-Date -Format “yyyy_MM_dd_hhmm”
CLS
Write-Host “Microsoft Windows 8.1 PowerShell Session Version 3.  Please continue…” -ForegroundColor Blue
Start-Transcript “C:\PSlogging\transcript.log”  -Append
Write-Host “================= Log Time:   $LogTime =============================” -ForegroundColor Yellow

-Enjoy!

Quickly Create Test Accounts

When looking to verify a process like mailbox migrations, sometimes a significant number of test accounts are required. You could go about it in the old fashioned (manual) way of creating each account one by one, or…

You can use PowerShell!

There are a few things required before beginning.

1. Create a .csv file with a few basic headers and some values.

This list is what will be used to create all the accounts needed. For example:

1-CSV

2. Open Notepad.exe and add this information in. 

$ErrorActionPreference = “SilentlyContinue”

function Select-FileDialog
{
 param([string]$Title,[string]$Directory,[string]$Filter=”CSV Files (*.csv)|*.csv”)
 [System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) | Out-Null
 $objForm = New-Object System.Windows.Forms.OpenFileDialog
 $objForm.InitialDirectory = $Directory
 $objForm.Filter = $Filter
 $objForm.Title = $Title
 $objForm.ShowHelp = $true
 
 $Show = $objForm.ShowDialog()
 
 If ($Show -eq “OK”)
 {
  Return $objForm.FileName
 }
 Else
 {
  Exit
 }
}

$FileName = Select-FileDialog -Title “Import an CSV file” -Directory “c:\”

$ExchangeUsersOU = “OU=TestUsers”

$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetComputerDomain()  
$DomainDN = (([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).Domains | ? {$_.Name -eq $domain}).GetDirectoryEntry().distinguishedName
$final = “LDAP://$DomainDN”
$DomainPath = [ADSI]”$final”
$cOU = $DomainPath.Create(“OrganizationalUnit”,$ExchangeUsersOU)
$cOU.SetInfo()

$UserInformation = Import-Csv $FileName

$OUPath = “LDAP://$ExchangeUsersOU,$DomainDN”
$UserPath = [ADSI]”$OUPath”
Write-Host “—————————————————————“
Write-Host “Creating LAB Users”
Write-Host “Version 1.1”
Write-Host “—————————————————————“

Foreach ($User in $UserInformation){
 
 $CN = $User.samAccountName
 $SN = $User.Surname
 $Given = $User.givenName
 $samAccountName = $User.samAccountName
 $Display = $User.DisplayName
 
 $LABUser = $UserPath.Create(“User”,”CN=$CN”)
 Write-Host “Creating User: $User.samAccountName”
 $LABUser.Put(“samAccountName”,$samAccountName)
 $LABUser.Put(“sn”,$SN)
 $LABUser.Put(“givenName”,$Given)
 $LABUser.Put(“displayName”,$Display)
 $LABUser.Put(“mail”,”$samAccountName@$domain”)
 $LABUser.Put(“description”, “Lab User – created via Script”)
 $LABUser.Put(“userPrincipalName”,”$samAccountName@$domain”)
 $LABUser.SetInfo()
 
 $Pwrd = $User.Password
 
 $LABUser.psbase.invoke(“setPassword”,$Pwrd)
 $LABUser.psbase.invokeSet(“AccountDisabled”,$False)
 $LABUser.psbase.CommitChanges()

}
Write-Host “Script Completed”

3.  When finished, save as “NEWLABUSERS.ps1”

This script will create new accounts in Active Directory based on the .CSV file in step 1.  The accounts will be created in an OU called “OU=TestUsers”.

4.   To create corresponding Exchange mailboxes for these test users, Run the following cmdlet from the Exchange Management Shell;

Get-User -OrganizationalUnit “OU=TestUsers,DC=domain,DC=com” -Filter ‘RecipientType -eq “user”‘ | ForEach-Object { $email = $_.FirstName +”.”+ $_.LastName +”@domain.com“; Enable-Mailbox -Identity $_.SamAccountName -DisplayName $_.DisplayName -Alias $_.SamAccountName -PrimarySmtpAddress $email -Database “ExchMBXServer\SG1\database“}

*NOTE: on each variable that has a strikethrough above, change the variable to ones within your organization.  “OU=TestUsers,DC=contoso,DC=com” and “@contoso.com” and “ExchMBX01\First Storage Group\defaultdatabase”