mhamer
asked on
Powershell Ifmemeber type command?
Hi im looking to create a powershell script that checks group membership and does various things based on outcome
ifmember of group 1 then do job1
ifmember of group 1 then do job 2
if member of group 3 then job 3
carry on with script
type if thing, imm sure you get the idea :-)
i can do this with ifmember just looking for powershell equivilant.
ifmember of group 1 then do job1
ifmember of group 1 then do job 2
if member of group 3 then job 3
carry on with script
type if thing, imm sure you get the idea :-)
i can do this with ifmember just looking for powershell equivilant.
ASKER
will be a deployment by sccm
would have like to do one PS script but i guess three seperate packages would do.
so the PS script will be called by sccm install.cmd
would have like to do one PS script but i guess three seperate packages would do.
so the PS script will be called by sccm install.cmd
ASKER
not sure if this helps but..
the package runs as a (svc account )
a seperate package ruiing as a user process will then copy the files to profile path (as administrater)
the package runs as a (svc account )
a seperate package ruiing as a user process will then copy the files to profile path (as administrater)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great thank you will give that a go
What context are you running this in?
PS doesn't have an IfMember equivalent. You can write one, or you can use a number of different methods exposed by the .NET framework. Which is appropriate depends on context.
Chris