1

I'm running below lines in VBA in Access

cmd = "powershell -ExecutionPolicy Bypass -Command ""&{. 'C:\Users\chb8wz\Desktop\users.ps1';countLines -logFile '" & fname & "'}"""
Shell cmd

The script "users.ps1" returns the value of number of user from particular OU:

$Users = (Get-ADUser -Filter * -SearchBase "ou=Useraccounts").count

How can I save the value of users (e.g powershell returns 200) to a variable in VBA?

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.