Author Topic: Quest AD tools  (Read 2697 times)

mathia

  • Newbie
  • *
  • Posts: 43
Quest AD tools
« on: February 28, 2014, 07:04:30 am »
Has anyone been able to get these to work in Winbatch?  I probably need to do more studying up on using CLR, but I thought I would give it a shot.  I am finding that I don't know enough about dll's in general to make much headway.  So far, I've got...

assemblydir = 'C:\Program Files\Quest Software\Management Shell for AD\'
ObjectClrOption('appbase',assemblydir)
ObjectClrOption ('use','Quest.ActiveRoles.ArsPowerShellSnapIn, Version=1.1.0.0, Culture=neutral, PublicKeyToken=37ba620bec38a887')

ref = ObjectClrNew( 'Quest.ActiveRoles.ArsPowerShellSnapIn')

It seems to load, but fails on the last step.  I am not sure what the entry should be.  I'm not actually sure I am even using the correct dll.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Quest AD tools
« Reply #1 on: February 28, 2014, 08:09:07 am »
Sorry not familiar with Quest AD tools. Do you have the documentation for the assembly?

If its a PowerShell cmdlet you want to execute see:  http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/dotNet/System_Management/Automation/PowerShell+PowerShell~Invoke~Command~with~Grid~PassThru.txt
Deana F.
Technical Support
Wilson WindowWare Inc.

td

  • Tech Support
  • *****
  • Posts: 3019
    • WinBatch
Re: Quest AD tools
« Reply #2 on: February 28, 2014, 09:37:21 am »
Has anyone been able to get these to work in Winbatch?  I probably need to do more studying up on using CLR, but I thought I would give it a shot.  I am finding that I don't know enough about dll's in general to make much headway.  So far, I've got...

assemblydir = 'C:\Program Files\Quest Software\Management Shell for AD\'
ObjectClrOption('appbase',assemblydir)
ObjectClrOption ('use','Quest.ActiveRoles.ArsPowerShellSnapIn, Version=1.1.0.0, Culture=neutral, PublicKeyToken=37ba620bec38a887')

ref = ObjectClrNew( 'Quest.ActiveRoles.ArsPowerShellSnapIn')

It seems to load, but fails on the last step.  I am not sure what the entry should be.  I'm not actually sure I am even using the correct dll.

Your best bet may very well be doing as Deana suggested and use the dotNet FCL Powershell classes to execute cmdlets. 

In theory, it might be possible to access the classes contained in the Quest.ActiveRoles.ArsPowerShellSnapIn assembly directly without having to use the PowerShell classes.  A call to ObjectClrNew might look something like

Code: Winbatch
objComp = ObjectClrNew( 'Quest.ActiveRoles.ArsPowerShellSnapIn.QADComputer')

This is only a very uneducated guess so I have no idea if it will work.  If you happen to be the adventurous type and with time to kill, it might be worth a try.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade