Tuesday, November 27, 2012

The file does not contain valid publish settings for Windows Azure

Today, while trying to add a new Azure Cloud Service Project, I got an error when configuring my Azure profile. The message told me that the profile file freshly downloaded from Azure website was invalid and cannot be used in the Azure Project…

image

I’ve found in the Azure Tools 1.8 release not that the publishingsettings profile schema has been updated in this release and if your Azure website has been created with a previous release, the publishing profile file cannot be used in a 1.8 Azure project…

http://msdn.microsoft.com/en-us/library/windowsazure/ff683673.aspx#BK_October2012

“The format of .publishsettings files have changed with this release. You can't use an earlier version of the Windows Azure Tools to open a .publishsettings file that was created with the 1.8 version. You can use the 1.8 version to open .publishsettings files that were created with earlier versions of the tools. You can determine whether a .publishsettings file uses the new format by opening it in a text editor and looking for the SchemaVersion element. If the file contains the element<SchemaVersion="2.0">, the file is in the 1.8 format. If you try to use an earlier version to open a file that's in the 1.8 format, the file fails to open, and the following error message appears: The file File.publishsettings does not contain valid publish settings for Windows Azure.”

Solution:

- Create a new Azure Website

- Enter the profile parameters manually instead of using the publishing profile file.

Hope this helps !

Friday, November 16, 2012

Get Active Directory Group Members with PowerShell

I’ve not blogged for quite a while. Let’s come back with a small PowerShell script for retrieving Active Directory Group Members.

The bellow scripts retrieve all the Active Directory groups in a specific OU and count the number of members.

Import-Module ActiveDirectory

$groups = Get-ADGroup -searchbase "OU=MyOU,DC=myDC,DC=net" -filter *

$myArray = @()

foreach($g in $groups)

{

$members = Get-ADGroupMember($g)

$myObject = New-Object System.Object

$myObject | Add-Member -type NoteProperty -name Name -Value $g.Name

$myObject | Add-Member -type NoteProperty -name Count -Value $members.Length

$myArray += $myObject

}

$myArray