Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Users might experience few discrepancies in Search results. We are working on this on our side. We apologize for the inconvenience it may have caused.
New Member

Extract Variables from Powershell Script

Hey Guys

I am building a workflow that sync's active directory to the IAC database and i am looking to make it as efficient as possible by reducing the amount of powershell scripts I use into one and then utilise the powershell variables to get what i need.

Is it possible to extract the stored variables into a workflow variable as opposed to using the output of the powershell statement?

Has anyone else built a workflow that sync's users to a DB that runs efficiently possible on the when modified date at the moment mine takes 28 minutes to sync 200 users.

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
Silver

Extract Variables from Powershell Script

From a design perspective, I would suggest to use the Generic OLEDB database adapter.  There is an OleDB provider for Active Directory called ADsDSOObject. You can find it through a search on the Microsoft site.  It may be installed as a part of standard Windows or .Net.  Not sure. If you could get this registered on the PO server, you would be able to do a select and use the output as a native table instead of Powershell output parsing.

Powershell tends to be non-performant.  Definitely I would caution against calling PowerShell repeatedly in a loop.

4 REPLIES
Cisco Employee

Extract Variables from Powershell Script

Matthew,

Currently the variables of a powershell script would not be an exposed property. You would have to use something like an echo or write to output their values to the screen and then capture those from the exposed output property.

I have not done anything like you describe but you might also look in the solution accelerator community. (or hope someone else posts here)

--Shaun Roberts
shaurobe@cisco.com
CIAC Adoption Pilot Engineering Lead

--Shaun Roberts shaurobe@cisco.com CIAC Adoption Pilot Engineering Lead
New Member

Extract Variables from Powershell Script

Hi Shaun

Thanks for the reply.

That was what i am doing at the moment, but as you can imagine to get the properties i have to run 5-6 scripts per user and even in parallel this isnt a fast process.

I will look and post in the other forums as you have suggested.

Matt

Silver

Extract Variables from Powershell Script

From a design perspective, I would suggest to use the Generic OLEDB database adapter.  There is an OleDB provider for Active Directory called ADsDSOObject. You can find it through a search on the Microsoft site.  It may be installed as a part of standard Windows or .Net.  Not sure. If you could get this registered on the PO server, you would be able to do a select and use the output as a native table instead of Powershell output parsing.

Powershell tends to be non-performant.  Definitely I would caution against calling PowerShell repeatedly in a loop.

New Member

Extract Variables from Powershell Script

Hi Von

Thats great i did not think of doing it this way. I was able to do it by executing a windows script with the OLEDB Provider.

you have solved all my issues

Regards,

matt

156
Views
0
Helpful
4
Replies
CreatePlease to create content