Return $var in function

Hello all,

Having some problems with a script returning $var from functions.

I have the functions as the follow example:

$folderOwner = (Process-ADObj($owner))[0]  ####(here i just want value $ADobjid)

$aclId = Process-ADObj($ADuser) ##(here i want varaibles $ADobjid and $ACL_TYPE_USER)

Function process-ADObj($owner) (returns following variables)

$ADobjid

$ACL_TYPE_USER

###END########

How can i get only 1 values in $ADobjid for funciton $folderOwner  and  $ADobjid and $ACL_TYPE_USER for function $aclId?

Any help is welcome.

Regards,

August 19th, 2015 2:22pm

Functions must be stated BEFORE they are called.

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 2:29pm

I am declaring it before. just dont know how to get them of... :(
August 19th, 2015 4:36pm

you are declaring it at the end of the script.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 4:46pm

Just in the post : in the script its before
August 19th, 2015 4:47pm

If you want help you have to post an accurate script with a clear error message.

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 4:52pm

$folderOwner,$aclId=Process-ADObj $ADuser
August 19th, 2015 4:54pm

tks mate

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 4:56pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics