cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1004
Views
0
Helpful
4
Replies

Extract Variables from Powershell Script

Matthew Horvat
Level 1
Level 1

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

Von Jones
Level 4
Level 4

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.

View solution in original post

4 Replies 4

Shaun Roberts
Cisco Employee
Cisco Employee

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
Principal Engineer, CX
shaurobe@cisco.com

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

Von Jones
Level 4
Level 4

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.

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