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

 

Quick note on PowerShell 3.0

Powershell

Today I had some time to test some of the new Windows PowerShell 3.0 feature and changes. And after playing a while with the Windows PowerShell 3.0 CTP I have to say Microsoft did besides the big new features, like workflows, a lot of small but really important improvements.

First I will show you two very small but very cool things which make working with PowerShell a lot easier.

New help view, which I really like. Here quick PowerShell 2.0 versus PowerShell 3.0:

Second I would like you to show how they simplified PowerShell for daily use. Here Get-Childitem for an example:

In PowerShell 2.0:

Get-Childitem | Where {$_.name -eq "Desktop"}

In PowerShell 3.0 you can do this now much friendlier:

Get-Childitem | where name -eq Desktop

powershell 2.0 vs 3.0 childitem

Windows Management Framework 3.0 Community Technology Preview

 

Powershell

Some days ago the Microsoft Powershell Team released the Community Technology Preview of the Windows Management Framework 3.0 which includes Windows PowerShell v3. You can download the the CTP1 here and it requires Windows 7 SP1 or Windows Server 2008 R2 with SP1.

You can use very easy both PowerShell versions sie by site.

powershell.exe -Version 3.0

powershell.exe -Version 2.0

But the Windows Management Framework 3.0 CTP1 does not only includes PowerShell 3, it also contains new versions of WMI, WinRM and the new Windows PowerShell Webservice.

Windows PowerShell 3.0

  • Workflows
    Workflows that run long-running activities (in sequence or in parallel) to perform complex, larger management tasks, such as multi-machine application provisioning. Using the Windows Workflow Foundation at the command line, Windows PowerShell workflows are repeatable, parallelizable, interruptible, and recoverable.
  • Robust Sessions
    Robust sessions that automatically recover from network failures and interruptions and allow you to disconnect from the session, shut down the computer, and reconnect from a different computer without interrupting the task.
  • Scheduled Jobs
    Scheduled jobs that run regularly or in response to an event.
  • Delegated Administration
    Commands that can be executed with a delegated set of credentials so users with limited permissions can run critical jobs
  • Simplified Language Syntax
    Simplified language syntax that make commands and scripts look a lot less like code and a lot more like natural language.
  • Cmdlet Discovery
    Improved cmdlet discovery and automatic module loading that make it easier to find and run any of the cmdlets installed on your computer.
  • Show-Command
    Show-Command, a cmdlet and ISE Add-On that helps users find the right cmdlet, view its parameters in a dialog box, and run it.

WMI

  • A new provider development model
    This new model brings down the cost of provider development and removes the dependency on COM.
  • A new MI Client API to perform standard CIM operations.
    The API can be used to interact with any standard WsMan + CIMOM implementation, allowing management applications on Windows to manage non-Windows computers.
  • The ability to write Windows PowerShell cmdlets in native code
    The new WMI Provider APIs supports an extended Windows PowerShell semantics API allowing you to provide rich Windows PowerShell semantics. e.g., Verbose, Error, Warning, WhatIf, Confirm, Progress

WinRM

  • Connections are more robust
    Session disconnect and reconnect, with or without client session reconstruction, allows long-running tasks to continue even when the session in which they were started is closed and the client computer is shut down. This feature also allows administrators to reconnect from different computers to check the status of remote running tasks and get results.
  • Connections are more resilient
    In Windows PowerShell 3.0 CTP1, connections can survive short-term network failures; the client-server connection is not severed at the first sign of trouble. If network problems persist, the client is safely disconnected and can reconnect by using the Connect-PSSession or Receive-PSSession cmdlets.

Windows PowerShell Web Service

Windows PowerShell Web Service enables an administrator to expose a set of PowerShell cmdlets as a RESTful web endpoint accessible via the Open Data Protocol (OData). This provides remote access to invoke cmdlets from both Windows and non-Windows clients.

You can get more Information about the Windows Management Framework 3.0 Community Technology Preview on the Windows PowerShell Team Blog.

Hyper-V 3: Attach multiple VHDs via PowerShell

Powershell Hyper-V Attach VHDs
We are already testing some Windows Server 8 installations and to test some of the new storage features I needed to attach a lot of VHDs to a Virtual Machine. Now with this Windows PowerShell script its very easy and fast.

Important:

  • Needs Windows Server 8 (Developer Preview)
  • Needs Hyper-V 3 (Inculded in Windows Server 8 )
  • Needs PowerShell v3 (Also included in Windows Server 8 )
$filePath = "\\storage01\VHDStorage\Virtual Hard Disks\"
$fileName = "server03-disk" # Your VHD will be called yourvhdnameX.vhdx (X = Number)
$serverName = "server03"
$controllerNumber = "0"
[int64]$vHDSizeGB = "100" # in GB
$vHDFormat = "vhdx" # vhdx or vhd
$vHDType = "Dynamic"
$numberofVHDs = "8"

for ($i=1;$i -le $numberofVHDs; $i++){

    $vHDPath = $filePath + $fileName + $i + "." + $vHDFormat
    New-VHD -Path $vHDPath -SizeBytes ($vHDSizeGB * 1073741824) -VHDFormat $vHDFormat -VHDType $vHDType
    Add-VMHardDiskDrive -VMName $serverName -ControllerType SCSI -ControllerNumber $controllerNumber -Path $vHDPath

}

The best thing overall is how you fast you can create such scripts with PowerShell v3. It took me like 10-12 minutes to get this thing done, and if you think how I would have to create and attach all of those VHDs with the wizard, I saved myself a lot of time.

Windows 8: Client Hyper-V and boot from VHD

Windows 8 Client Hyper-V

Some days before the BUILD conference, Microsoft released a video about Hyper-V in Windows 8. Now after some days of testing I am already a big fan of the client Hyper-V. It lets me create a perfect lab at work or a development VM and Linux VM’s for KTSI.

It’s a great solution for me. Sure there were other solutions like Virtual PC, Virtual Box and VMware Workstation before, but using the built-in Hyper-V has some advantages which make my life a little easier.

  • PowerShell support – it lets me start up a whole lab environment within seconds. I can really quick import Virtual Machines and start them up. And also do some other cool scripted solutions.
  • Performance – it offers great performance.
  • VHD and VHDX – it’s great to work with one virtual disk format and not have to convert virtual disks. It’s also great together with the boot from VHD feature.
  • Dynamic Memory
  • Remote Management for Hyper-V Servers (like the RSAT)
  • Live Storage Migration – Move a running Virtual Machine from local disk to another local disk, USB or network share and back

Microsoft made also the boot from VHD feature a little simpler.

  1. First Mount the VHD you want to boot. (right click on the VHD and “Mount”)
    mount vhd
  2. Now check the new drive letter of the VHD in my case this is G:
  3. Open the command prompt and type bcdboot G:\windows
    bcdboot
  4. Now your VHD will appear in the boot menu. You can check that by typing bcdedit
  5. and as you can see no sysprep or generalize needed

Here a small list of Hyper-V client features:

  • 32 Virtual CPUs
  • NUMA in VM
  • 512 GB RAM
  • Sleep, Hibernate
  • Management console
  • Manage Hyper-V Server from this console
  • Snapshots
  • Up to 1024 running VM’s
  • VHD, and VHDX (up to 16TB)
  • Dynamic disks, Differencing disks, pass through disks, fixedsize disks
  • 4K sector size
  • DMTF comliant WMI
  • Networking offloads
  • Live Storage Migration
  • Native VHD boot
  • Dynamic Memory
  • Remote Management
  • PowerShell
  • Export snapshots
  • Resource Pools
  • External, Internal and Private Networks
  • Bi-Direction audio
  • Enlightened IDE & SCSI controllers
  • Hyper-V on SMB
  • up to256 virtual drives
  • up to 12 virtual NICs
  • VLAN support
  • 3D Graphics (Software)
  • Mutli Touch
  • USB redirection (with RDP)
  • Wireless NICs
  • Export & Import VMs
  • Hyper-V Extensible Switch
  • VHDX Resiliency

Supported Operating Systems:

  • Windows XP SP3
  • Windows Server 2003 SP2
  • Windows Server 2003 R2 SP2
  • Windows Vista
  • Windows Server 2008
  • Windows 7
  • Windows Server 2008 R2
  • Windows Storage Server 2008 R2
  • Windows Home Server 2011
  • Windows SBS 2011
  • Windows 8
  • Windows Server 8
  • CentOS 5.2-5.6
  • CentOS 6.0
  • Red Hat Enterprise Linux 5.2-5.6, 6.0, 6.1
  • SUSE Linux Enterprise 10, 11

In my opinion Client Hyper-V is a great solution and lab to go for Developers, IT Pros, Testers, Sales people and a lot more.

 

Hyper-V: “Version 3 kills them all”

Windows Server 8 Server Manager Dashboard

Microsoft showed the latest version of Hyper-V at build conference together with Windows 8 and Windows Server 8. Microsoft showed a lot of new Hyper-V features which turn Hyper-V in really powerful hypervisor.

Some days ago I posted a blog post about new features which Microsoft showed before the build conference, now it’s time to extend the list of new features. There are a lot of even more powerful features than the once I posted back then.

Windows Server 8 as Cloud OS

First let’s start with Windows Server 8 as the base of Microsoft Cloud strategy. Microsofts focus in Windows Server 8 was to make it easy for all to build public and private cloud solutions. There are a lot of improvements to manageability, security, scalability, extensibility, predictability and reliability which will also improve the possibilities with Hyper-V. In technical terms Microsoft made a lot of improvements how you can manage a lot of servers and services, Storage, Networking and Powershell. Of course there is a lot more, but this are the parts I think are the most important. And here are some keywords to the improvements in Windows Server 8:

  • Storage improvements – SMB 2.2, SMB transparent Failover, Data deduplication, Storage Spaces, online filesystem repairs, 64TB NTFS volume etc.
  • NIC Teaming
  • Powershell v3 – You can now just do everything in Powershell and even more with 23000 PowerShell cmdlets.
  • Server Dashboard – The new Dashboard lets you manage all servers, or even better, all Services from one place.
  • Multi-tenant – everything seems to be made for that
  • Performance Counters

Windows Server 8 Hyper-V Manager

Hyper-V Host improvements

Hyper-V gets not only a lot of improvements to Virtual Machine, also the Hyper-V Hosts get some new limit improvements.

  • up to 160 logical CPUs
  • supports up to 2TB RAM
  • no more vCPU:pCPU ration limit

Hyper-V Virtual Machine improvements

Microsoft did a lot to extend the existing Virtual Machine hardware to support even high workload Virtual Machines. I will not write a lot about this because the facts here will tell more that a lot of words.

  • VHDX Format – supports up to 16TB Virtual Disks
  • 32 CPUs per VM
  • 512GB RAM per VM
  • Support for Fibre Channel Adapters
  • Supporting Virtual Active Directory Servers

Hyper-V Networking improvements

Hyper-V got a lot of improvements in terms of networking. Microsoft realized that networking features are really important if you start to create private and public cloud scenarios and now even create a mix of public and private cloud scenarios without creating a lot of work for the IT teams to reconfigure Virtual Machines.

  • QoS and flexible bandwidth allocation
  • Support for SR-IOV (Direct Access to the physical Network adapter)
  • Network Virtualization
  • PVLAN support
  • Dynamic Virtual Machine Queue (D-VMQ)
  • Receive Side Coalescing (RSC)
  • DHCP Guard
  • Extensible virtual switch
  • IPsec Task offload

Hyper-V Clustering improvements

Hyper-V gets also a lot of Cluster improvements. But you have to be aware that Clusters are for really high availability and this adds a lot of costs to projects and solutions. Microsoft is working on Cloud solutions which will give great availability to low cost. For example Hyper-V Replica or Live Migration to another host over the Ethernet without the need for a shared storage. But if you need real HA you will need the Failover Cluster.

  • supporting up to 4000 VMs per cluster
  • supporting up to 63 Cluster nodes
  • improved Cluster Manager Console
  • VM Monitoring – Application health detection inside the virtual machine
  • New Placement policies – Virtual Machine Priority and enhanced placement
  • Storage Live Migration
  • Hyper-V Replica supporting clustering
  • No need for Block Storage – you can use SMB Shares
  • Support for Storage Spaces
  • Automated Node Draining – like Maintenance mode in SCVMM
  • Cluster Aware Updating
  • Cluster Shared Volume Improvements – BitLocker support, a lot of performance improvements, Self-Healing
  • Live Migration Queing
  • Migrate multiple Virtual Machine at the same time

Windows Server 8 Hyper-V VM Move

Hyper-V Storage improvements

A I mentioned earlier Microsoft made a lot of improvements in terms of storage in Windows Server 8 and Hyper-V can take advantage of those which are quiet impressive. For example with the new features in SMB 2.2 you can now use SMB file shares to store your Virtual Machines.

  • VHDX
  • ODX
  • RDMA
  • SMB 2.2 – Transparent Failover
  • 4K native disk support
  • Data Deduplication
  • Virtual Fiber Channel
  • VM boot from SAN

Hyper-V Management Improvements

As everywhere in Windows Server 8 PowerShell is the key. And the new Server Manager Dashboard Microsoft enable to create Server Groups to manage multiple servers from a single console.

  • Powershell for Hyper-V
  • Powershell Workflows – Commands and Tasks across servers
  • Hyper-V Extensible Switch – lets vendors to create “plugins”. Could be very interesting for Cisco UCS installations.
  • Server Manager Dashboard – lets you manage multiple Hyper-V host from a single console.
  • SCVMM 2012 – not a part of Windows Server 8 but will add great management solutions

Windows Server 8 Hyper-V Powershell

Hyper-V HA and Data Protection

Now I think this is maybe the greatest new feature. You can now live migrate a Virtual Machine from one Hyper-V Host to another without Shared Storage or Cluster configuration. And with this option Microsoft also included a new feature called Hyper-V Replica which includes the option to replicate Virtual Machine to another host which can be hosted in the same network or even in the cloud.

  • Live Migration
  • Live Storage Migration
  • Live Migration to another Hosts (Not clustered) over the Ethernet
  • Hyper-V Replica – Replicated Virtual Machines to another Hyper-V host on-premise or public cloud
  • BitLocker support for CSV

This are not all of the new features Windows Server 8 Hyper-V has to offer but I tried to list the important ones. And if Microsoft sticks with their licensing model, it will be a really strong competitor to the VMWare vShpere 5.