Brian Madden Logo
Your independent source for application and desktop virtualization.
Marketplace

advertisement

Script to remove a user from a published application, in the Scripting / Automation forum on BrianMadden.com

rated by 0 users
This post has 1 Reply | 1 Follower

Top 10 Contributor
Points 26,726
Dan Murray Posted: 09-17-2008 3:31 PM
I'm trying to get a script together that will, in part, remove a user from a published application. I'm very close, and can get the user removed, but it seems to want to duplicate the next user in the app and show them twice. As a test, I had two users assigned to a test app. When I use the script to remove the first user, the second user shows up twice!

Is there some special way you have to use the RemoveUser function, or is there another way of doing it?

All help would be appreciated!

Thanks in advance.

Dan
DON'T FORGET TO VOTE!!!

Why is it called "Common Sense"? It doesn't seem all that common!
Top 500 Contributor
Points 385

The method you want is RemoveUser() which is a tad tricky to use. The method takes 4 parameters
RemoveUser (MFAccountAuthorityType, string, MetaFrameAccountType, string)

So Something like

RemoveUser(1,"DomainName",2,"UserName")

 

Here are some of the enums

# Account Types

$MFAccountTypeUnknown = 0

$MFAccountLocalUser = 1

$MFAccountDomainUser = 2

# Account Authority Type

$MFAccountAuthorityUnknown = 0

$MFAccountAuthorityNTDomain = 1

$MFAccountAuthorityNDS = 2

$MFAccountAuthorityADS = 3


btw... if you are interested I have numerous blog post on managing Citrix with Powershell on my site
http://bsonposh.com/archives/tag/citrix 

Brandon Shell [MVP]
a.k.a BSonPosh

Note: If you want help learning Powershell or your struggling with some concepts... feel free to contact me through a post or my blog. I spend what time I have helping you learn. I do think I should be clear... I want to help you LEARN... not do your job for you. I will NOT simply write scripts for you if I do not think you wish to learn. I will spend hours if I think I can help you learn... I will not waste 5mins if I think your just want an easy way out.
  • | Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 1997-2008 The Brian Madden Company, LLC | Disclosures | Privacy | Terms of Use | Contact Info