As Active Directory management from PowerShell is very important to me in my daily work as I do all AD, SMS and MOM management from PowerShell as well as some of the others in my department allready ;-) ,
As you could see here : PowerShell RC2 and Active Directory I do not like the Wapper added in RC2.
I have a lot if discussions about it ,
in the NewsGroup (Yes Finaly Google has Indexed the PowerShell NG )
Syntax ([ADSI] removed by google)
getting COM properties . ([ADSI] removed by google)
ADSI - AD access changes/issues in RC2
and on IRC , there I got this remark :,
<dreeschkind> guys, you need to vote if you want to achieve anything
<dreeschkind> https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=213764&SiteID=99
And ofcourse did add a 5 ;-)
In the Newsgroup Threads Aruk Kumaravel explains a bit more about the wrapper and about the methods added (hidden),
Create
Put
Set
PutEx
SetEx
GetInfo
SetInfo
and he has also some examples on his blog using the new wrapper :
http://blogs.msdn.com/arulk/archive/2006/07/25/678137.aspx
http://blogs.msdn.com/arulk/archive/2006/07/28/682289.aspx
http://blogs.msdn.com/arulk/archive/2006/08/24/719241.aspx
Most people I did hear so far that are using PoSH for AD do not like it, and the questions on the NGm
also ofcourse I did,some more comparing and testing also, here you see some examples of the differences added by the wrapper :
Note that PsBase has no Tabcompletion.
# Old
$user.rename('cn=mow')
$root.invoke('MoveHere','LDAP://CN=mow,OU=MowOu,DC=mow,DC=local','cn=mowMoved')
# New
$user.psbase.rename('cn=mow')
$root.movehere('LDAP://CN=FooBar,DC=mow,DC=local','cn=FooMoved')
# New (not working )
([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').'AccountDisabled'
([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').get('AccountDisabled')# Old way ( works ) :
([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').psbase.invokeget('AccountDisabled')
as you could see here : PowerShell and Active Directory Part 3 (UserProperties) , (last part of post) the ADSI COM Object has some added Method Properties, for a list see : Interface Property Methods. on MSDN
I do not know how to do it yet using the wrapper, (see last NG thread [ADSI] getting COM properties . )
PS C:\PowerShell> ([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').'AccountDisabled'
PS C:\PowerShell> ([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').get('AccountDisabled')
Exception calling "get" with "1" argument(s): "The directory property cannot be found in the cache.
"
At line:1 char:49
+ ([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').get( <<<< 'AccountDisabled')
PS C:\PowerShell>
PS C:\PowerShell> # Old way (works):
PS C:\PowerShell>
PS C:\PowerShell> ([adsi]'LDAP://CN=FooMoved,DC=mow,DC=local').psbase.invokeget('AccountDisabled')
True
As I have almost 1500 readers of the first post of the series PowerShel and Active Directory Part 1 , and 626 that came to PowerShell and Active Directory Part 3 (UserProperties) , so if you have done that start (and did read the NG threads), you have experince with the process and can give valuable feedback,
Do you think is more easy to get started with Active Directory in PowerShell in RC1 or RC2 ?
As that was the main goal of this change I think.
please Vote : https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=213764&SiteID=99
or join the discussion in the microsoft.public.windows.powershell NewsGroup
Let know what you think !,
(OK sorry one more complaint ;-) )
I still think that for this little value that.emulating VbScript this wrapper does add for someone starting with PowerShell (when he is coming from VbScript, and knowing all the Methods by Head ;-) ) ,
This wrapper does to much concessions to the usability of PowerShell for more advanced administrator tasks, for using /converting all examples in other .NET languages (C#,IronPyhon,VB.NET,PowerShell), Developers to use PowerShell as a Tool , or to glide to a making a CmdLet , and it is very confusing, making exploring and Learning harder.
I think the way forward, using the Framework, is the best way , see also all changes in .NET2.0 for managing AD infrastructure : /\/\o\/\/ PowerShelled: AD Infrastructure exploring with MSH (AD is managed by admin's, not by end-users ) , as you could see in the Part 3of the series, and the example in this post, it is already easy enough to get to those Hidden Methods added by the wrapper, and we have best of both worlds.
Also Get-Member is one of the most used and important commands in PowerShell , and in exploring Objects , and we have to be able to trust it to be consistent and complete, as it is one of our eyes into the PowerShell World.
So I think that hiding important information from it, for some also hidden added methods is the wrong way to go on the glidepath, and I see almost nothing for it in return, as for typing PSBase.
End of campain !
Enjoy,
Greetings, /\/\o\/\/
Tags : Monad PowerShell
October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 April 2006 May 2006 June 2006 July 2006 August 2006 September 2006 October 2006 November 2006 December 2006