Archive for June 4th, 2007

PowerShell webcast from TechEd

The Tuesday PowerShell session is going to be webcasted (live!) for everyone out there who wanted to be on the TechEd but could not make it. Don Jones will give most of the session and I will try to get in for the last few minutes to give a quick introduction to the AD cmdlets and – if time permits – PowerGUI.

Register here:

TechNet Webcast: Microsoft Windows PowerShell: The Future of Server Administration (Level 300) 

Tuesday, June 5, 2007

10:00 A.M.–11:15 A.M. Pacific Time (1 pm EST, 6 pm GMT, 7 pm CET)

Tags:

Alternate credentials for AD cmdlets

By default, AD cmdlets use your current credentials. This is great and handy (I can just run Get-QADUser as the new command and it will work) but quite often you might want to specify another username/password. For example, when what you are planning to do requires a privileged account and the default account with which you logged in is just a Domain User.

Well, as usual, Connect-QADService is here to help. There are two ways you can specify the credentials. As a username/password pair:

$pw = read-host "Enter password" -AsSecureString
connect-QADService -service 'server.company.com'-ConnectionAccount 'company\administrator'-ConnectionPassword $pw

Or use the Get-Credential cmdlets which will display the familiar dialog box:

Connect-QADService -service 'server.company.com' -Credential ( Get-Credential )

Once you’ve run any of those all your subsequent AD cmdlets run under this new account until you run Disconnect-QADService which removes the connection and brings you back to the defaults:

Connect-QADService -service 'server.company.com' -Credential ( Get-Credential )

# now we are using the specified credentials

Get-QADUser

Disconnect-QADService

# now we are back to the current account

Tags: , , , , , , ,


My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

June 2007
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

%d bloggers like this: