URGENT!!!! How to list users from a content of groups in Quest PowerShell! HELP!!!

Hi everybody
I have this script:
$out = @()
Get-Content D:\Tools\Reportes_Power_Shell\Contenedor_Power_Shell\Users.txt | ForEach {
    $date = (Get-Date).ToString()
    $username = $_
    $displayName = (Get-QADUser $username -Properties DisplayName).DisplayName
    $groups = Get-QADMemberOf $username | Sort-Object Name
    ForEach ( $group in $groups ) {
        $obj = New-Object -TypeName PSObject
        $obj | Add-Member -MemberType NoteProperty -Name Date -Value $date
        $obj | Add-Member -MemberType NoteProperty -Name UserName -Value $username
        $obj | Add-Member -MemberType NoteProperty -Name DisplayName -Value $displayName
        $obj | Add-Member -MemberType NoteProperty -Name GroupName -Value $group.name
        $out += $obj
$out | Export-CSV D:\Tools\Reportes_Power_Shell\Reportes_de_Power_Shell_y_AD_Info\Users_Memberships.csv
What I need now is exactly the opposite, I need to put Groups in a container and in the same format list all users within plus the cmdlet "AccountIsDisabled". I need this ASAP, could you help me?
Thanks a lot.

Hi,
Based on what I can gather, you're looking to read in an input file of group names, check each group's membership, and then export that information to a CSV file.
I don't have the Quest tools, but here's how I'd do this with the AD module:
Get-Content .\groupList.txt | ForEach {
$groupName = $_
Get-ADGroupMember $_ | ForEach {
$props = @{
'Group Name'=$groupName
UserName=$_.SamAccountName
Name=$_.Name
DisplayName=(Get-ADUser $_.SamAccountName -Properties DisplayName).DisplayName
New-Object PsObject -Property $props
} | Export-Csv .\groupMembers.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 12,420+ strong and growing)

Similar Messages

  • How to Remove User from Built in Administrators group With Group Policy Enabled

    Hi,
    I want to remove user from Administrator group which is in restricted group. So I cannot remove him through Active Directory what is the way to remove user from Administrator restricted group.
    Thanks
    Jibran Ishtiaq

    > Disable Group policy
    "Edit", not "Disable"
    > Under Domain click Delegation and went to the restricted group account.
    > Remove User from group.
    Why "Delegation"? Simply edit the GP object where the "Restricted
    Groups" setting is in place...
    > Also we have two DNS but one from where I remove account is the primary.
    How is DNS related to group policy?
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • How to Block user from Sending IM or Hide Presence of there user who is not in his department

    Hi All,
    How to Block user from Sending IM or Hide Presence of there user who is not in his department.
    Thank you

    Hi Jp,
    Method 1:
    You can use the Enhanced Privacy Mode in Lync 2013
    <section class="ocpSection">
    Enable Privacy Mode
    By default, everyone except Blocked Contacts can see your presence status. To modify the privacy settings, you can do the following:
    In the Lync main window, click the Options button.
    In the Lync - Options dialog box, click Status, and then do one of the following:
    Click I want everyone to be able to see my presence regardless of system settings (override default settings).
    Click I want the system administrator to decide - currently everyone can see my presence but this could change in the future.
    </section>
    About Enhanced Privacy Mode
    If your organization has enabled Enhanced Privacy Mode in Lync, you can choose whether to limit visibility of your presence information to only those people you’ve added to your Contacts list. You do that by selecting one of the following on the
    Options->Status window:
    I want everyone to be able to see my presence
    I only want people in my Contacts list to see my presence
    Method 2:
    Using Privacy Relationship, you can block a particular user by adding him to blocked contacts
    Anil Kumar (MCITP)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • How to redirect user from login page to "Set Challenge question" page

    How to redirect user from login page to "Set Challenge question" page (NOT custom page) after 3 un successful password attempts?
    Meaning when user types wrong password 3 times they will be redirected to set Challenge question page. If user answers the challenge question then password reset page should be appeared other wise (after remaining 3 un successeful challenge question answers) account should be locked out.
    thanks for your help.

    hi sandeep
    Thanks for your answer. Let me ellaborate more on the requirement here.
    - Password Policy and Lost Password management are set up in the identity system
    - Configure login tries allowed= 5. Verify accout is lock out after 5 unsucessful login.
    This is what need to achieve.
    1) If a user attempts to login 3(not 5) times using an incorrect login credential he/she should be redirected to set challenge question (security question) page.
    2) Then if the user attempts (remaining) 2 times incorrect challenge answer then his/her account should be locked out.
    3) If he/she answers the challenge answer correctly then he/she should be redirected to password reset page.
    Is this possible?

  • How to prevent users from creating new folders in share folder directory?

    Hello guys
    I'd like to know How to prevent users from creating new folders in share folder directory but still keep their power of creating new folders in their personal 'my folder'?
    I tried changing the 'manage privilage ---- create folder' to deny certain user accounts, but by doing so, it also stops the user from creating new folders in their 'my folder', which is not good..
    I also tried going into these share folders and tried different access types such as 'change/delete', 'read', 'traverse folder' etc, but none of it work ideally. The 'change/delete' access still allows them to create new folders, 'read' access prevents creating new folders but also take away their power of saving reports..
    Any thoughts on how to take away their ability to ONLY create new folders in share folder areas without affecting their other privileges?
    Please advise
    Thank you

    Easy, on the shared folders root folder only give them 'read' or 'traverse folder' but on the the folder inside the shared folders root folder give them 'change/delete'. That means they can change anything inside those folders but not create any folders at the shared folders root level.

  • HT1535 don't know how to sync favorite from my macbook pro to iphone5, can u help?

    don't know how to sync favorite from my macbook pro to iphone5, can u help?
    Thanks!
    Alfred

    Hey zurichzurich
    Check out the article below to setup the syncing of your bookmarks to your iPhone. You could also use iCloud to sync those for you automatically.
    iTunes 11 for Mac: Sync contacts, calendars, and other info with iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12117
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How to add users from person or group field in a sharepoint list to sharepoint group

    Hi,
    How to add users(single or multiple) from person or group field in a sharepoint list to sharepoint group programmatically?
    Any suggestions would be appreciated.
    Thank you,
    AA.

    Hello,
    Use SPGroup.AddUser() method to add user in group. I have just written sample code in notepad so it is not tested:
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using(SPSite Site = new SPSite(SPContext.Current.Site.Url))
    Using(SPWeb Web = Site.OpenWeb())
    SPList list = web.Lists["ListName"];
    SPQuery query=new SPQuery ();
    query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Eq></Where>";
    SPListItemCollection items = list.GetItems(query);
    if(items.Count > 0)
    foreach(SPListItem item in items)
    //Get USers from person or group column
    SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
    SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString());
    SPGroup spGroup = spSite.RootWeb.Groups[groupName];//group name
    if (users.Count != 0)
    bool isUserInGroup = false;
    foreach (SPFieldUserValue user in users)
    foreach (SPUser item in spGroup.Users)
    string itemUserName = item.LoginName;
    string UserName = user.User.LoginName;
    if (itemUserName == UserName)
    isUserInGroup = true;
    break;
    if (!isUserInGroup)
    spGroup.AddUser(user.User);
    The above code will query list item and then get users from "Users" column. Now it will check whetehr user is already in group not, if not then add user in group.
    http://rajanijilla.blogspot.sg/2012/09/add-users-to-group-programmatically.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to restrict users from printing documents and exporting to local file

    Hi SAP gurus,
    I have two questions.
    1. How can I restrict users from printing a document? i.e. billdoc? I would like to know if I could block it though authorization. If yes, what auth obj to use?
    2. How to restrict certain users from exporting to local file? the System> List>Save-->Local File. I have tried restricting it using auth object S_GUI but it seems it is only applicable to older versions of SAP. im on ecc6.
    Thank you in advance.

    Hi,
    Check this:
    Create your own gui status and attach it to the list in the event START-OF-SELECTION.
    In the menu painter extra -> adjust template.
    Make it a list status and you will see all the standard list options appear including list->download
    Deactivate the ones you don't want. 
    If you just want to prevent users from downloading the list you can achieve this with authorization object S_GUI, activity 61. Menu option will still be there though.
    Please note that if you remove authorisation for S_GUI activity 61 then all downloads will not be possible. 
    If you just want to disable downloads only for a particular report, you can try this test program:
    Code:
    REPORT ztest. 
      DATA: PROGNAME LIKE SY-CPROG value 'Z_CHECK_AUTH', 
            FORMNAME LIKE SY-XFORM value 'F_CHECK_AUTH'.
    START-OF-SELECTION. 
        CALL FUNCTION 'SET_DOWNLOAD_AUTHORITY' 
             EXPORTING 
                  FORM    = FORMNAME 
                  PROG    = PROGNAME 
             EXCEPTIONS 
                  OTHERS  = 1.
      WRITE: / 'TEST'.
    You also need this:
    Code:
    PROGRAM z_check_auth.
    FORM f_check_auth USING pe_result TYPE i. 
      pe_result = 5. 
    ENDFORM.
    Also have a look at the exit SGRPDL00.
    Hope this helps you.
    Rgds,
    Raghu

  • How to prevent users from saving and emailing intranet documents externally

    Someone in our company needs to upload a pdf to our sharepoint intranet site for internal-only use. How can I prevent users from downloading it and emailing it externally?
    I mean, a user could screenshot it I guess, but I need to give management a due diligence answer.

    You would need to look into a reverse proxy/firewall that had the ability to block access based on content. This isn't something you can accomplish out of the box with SharePoint (even with AD RMS).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to get users from Organizational Unit and with worker's subgroup

    Hi
    I am looking for a f. module to get the list of users from specific Organizational Unit and with specific worker's subgroup.
    I found f. module SWI_GET_USERS_OF_ORG_UNIT but it seems not working and only returns the users, how can I narrow the selection to get only from specific worker's subgroup?
    Thank you

    Hi,
    Try with FM RH_STRUC_GET with following parameters:
    ACT_OTYPE = O
    ACT_OBJID = worker's subgroup
    ACT_WEGID = SBESX
    Most important is to specify OBJID as the workers's subgroup, values for the others parameters may vary.
    Cheers.

  • How to list users under multiple groups and users sub groups

    Hi, I am stump, which is not hard to do. i have a list of groups and i want to list the users in those groups and then in the next column lists all the citrix only groups for each user. hopefully im describing that correctly. Heres what i have but it is
    not listing the users groups. I am not sure how to proceed.
    $CurrentDate = Get-Date
    $CurrentDate = $CurrentDate.ToString('MM-dd-yyyy_hh-mm-ss')
    $Groupname = "Distribution Lists"
    $excel = New-Object -comobject Excel.Application
    $excel.visible = $True
    $wbook = $excel.Workbooks.Add()
    $wsheet = $wbook.Worksheets.Item(1)
    $wsheet.Cells.Item(1,1) = "Groupname"
    $wsheet.Cells.Item(1,2) = "Member"
    $wsheet.Cells.Item(1,3) = "ACID"
    $wsheet.Cells.Item(1,4) = "Department"
    $range = $wsheet.UsedRange
    $range.Interior.ColorIndex = 19
    $range.Font.ColorIndex = 11
    $range.Font.Bold = $True
    $intRow = 2
    $groups = get-adgroup -Filter * -properties * -Searchbase "OU=Citrix,OU=Permission,OU=Groups,OU=Home Office,OU=domain,DC=Domain,DC=com"
    $targetFile = "c:\temp\$groupname $CurrentDate.csv"
    Add-Content $targetFile "Group;Member;ACID;Department"
    foreach ($group in $groups){
    $groupMembers = get-adgroupmember $group -Recursive | Get-ADUser -Properties Department, DistinguishedName| Where-Object { $_.Enabled -eq 'True' } | Select-Object Name, samaccountname, department, distinguishedname, @{n='MemberOf';e={$_.MemberOf -replace '^cn=([^,]+).+$','$1' -join '; '}
    foreach ($groupMember in $groupMembers){
    $groupName = $group.Name
    $memberName = $groupMember.Name
    $acid = $groupMember.samaccountname
    $groups = $usergroups
    #$department = $groupMember.department
    $department = $groupMember.memberof
    #$DistinguishedName = $gropmember.distinguishedname
    $line = "($groupName)--------($memberName)-----($acid)-------($department)------($usergroups)"
    add-content $targetFile $line
    $wsheet.Cells.Item($intRow,1) = $groupName
    $wsheet.Cells.Item($intRow,2) = $memberName
    $wsheet.Cells.Item($intRow,3) = $acid
    $wsheet.Cells.Item($intRow,4) = $groups
    $wsheet.Cells.Item($intRow,5) = $DistinguishedName
    $intRow++
    $WorkBook.EntureColumn.AutoFit()
    $excel.SaveAs("DL" + "name.xlsx")
    $excel.Close()

    Hi Glacket,
    Below codes should give you headsup.
    This command will give you estimate the result count for each group:
    PS C:\Users\Administrator> Get-ADGroup -Filter {Name -like "TestGroup*"} | Select Name, @{Expression={get-adgroupmember $_ -recursive | Measure | Select -ExpandProperty Count};Label="Count"}
    Name Count
    TestGroup1 7
    TestGroup2 8
    Note that as said earlier we are getting duplicated results(12,13,14) for users belonging to multiple groups. Result is in order as per earlier code's count and order.
    Get-ADGroup -Filter {Name -like "TestGroup*"} | get-adgroupmember -recursive | Select Name,@{Expression={Get-ADPrincipalGroupMembership $_ | Select -ExpandProperty Name};Label="GroupMemberOfName"}
    Name GroupMemberOfName
    User100 {Domain Users, TestGroup1}
    User14 {Domain Users, TestGroup1, TestGroup2}
    User13 {Domain Users, TestGroup1, TestGroup2}
    User12 {Domain Users, TestGroup1, TestGroup2}
    User11 {Domain Users, TestGroup1}
    User10 {Domain Users, TestGroup1}
    User1 {Domain Users, TestGroup1}
    User19 {Domain Users, TestGroup2}
    User18 {Domain Users, TestGroup2}
    User17 {Domain Users, TestGroup2}
    User16 {Domain Users, TestGroup2}
    User15 {Domain Users, TestGroup2}
    User14 {Domain Users, TestGroup1, TestGroup2}
    User13 {Domain Users, TestGroup1, TestGroup2}
    User12 {Domain Users, TestGroup1, TestGroup2}
    Use below to export to CSV:
    Get-ADGroup -Filter {Name -like "TestGroup*"} | get-adgroupmember -recursive | Select Name,@{Expression={Get-ADPrincipalGroupMembership $_ | Select -ExpandProperty Name};Label="GroupMemberOfName"} | Export-Csv C:\ListGroups.csv
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • How to open document from business content in weby dynpro ?

    Hello experts,
    I've cretaed a webdynpro where I want to display a document which is attached
    to a product in tx commpr01 in business content.
    I've tested method o_cl_crm_documents->get_with_url , but
    there I do not get a url in webdynpro.
    Does anybody know another method/fm to display such a document from
    business content in webdynpro ?
    Thanks and best regards
    Gerd

    Hello Mr. Jung,
    I'm sorry but I didn't find this method linktourl.
    In my web-dynpro I'm getting the url for my document after
    cklicking on the selected row.
    Then I just want to give this paramter to this linktourl method
    and open the document.
    How can I implement this method ? which class ?
    Thanks Gerd

  • How to prevent users from creating transactional problems?

    Dear Sirs...
    Using JDeveloper 10.1.2 and ADF UIX technology. If i created a web application that contains many pages. Assume the application contains pages A,B,C,D.
    The end user should access the pages A then B then C then D to get the transaction executed and commited correctly.
    the problem is:
    1- if a user navigates from A to B to C then he press the Back button to A then he commits the transaction, the data would be stored in correctly.
    2- if page C requires some preparations in page B (initalization of session variables) and the user enters page A then he changes the URL to C, then this would cause inproper execution of application and so the data would be stored incorrectly.
    so how can i prevent the user from pressing the back button of the browser (which i do not think is possible) or how can i prevent him from making any errors by inproper page navigation?
    thanks for any help in advance and best regards

    I really don't know if this is the correct way of doing it, but we prevent navigation directly to any page within our application if the HTTP Referer header is null. If it's null, we redirect to a page that says the user should use the navigation buttons provided and not enter the page via bookmarks, history, or direct navigation via a typed in URL.

  • How to prevent users from taking print through ME23N

    Hi Everyone,
    Please guide me for the following query:
    How can we restrict users from taking print through ME23N as through print preview in ME23N user is provided an option of taking print of the document.
    Please guide with authorization object information.
    Please guide.
    Thanks and Regards

    Hi Dear,
                     Consult with ur BASIS person.he can help u ........
    thanks

  • How to prevent users from entering '+' or '0' in front of country code in the phone number field?

    Requirement:
    How can I prevent guest users from entering '+' sign or '0' in front of country-code in the visitor phone number field during self registration?
    Few SMS service providers are not looking for '+' sign or '0' or '00' in front of the international phone numbers to trigger the sms. Providing these values in front of country code during self-registration may fail to deliver the sms to recipient.
    Solution:
    Using a simple regular expression, you can validate the entered phone number during the guest registration. 
    The below regular expression will help you to validate the phone number and allows to register only  when the phone number is not staring with '+' or '0'. 
    ^[1-9][0-9](\d{7}|\d{8}|\d{9}|\d{10}|\d{11}|\d{12})$
    It also performs the below validations.
    only numbers are allowed.
    first digit of the entered phone number should be 1 to 9, so '+' or '0' is not allowed. 
    numbers from 0 to 9 are allowed from the second digit.
    also validates phone number length, the length of the phone number should be 9 to 14.
    Configuration:
    To add the above regex in the visitor_phone number filed, please navigate to ClearPass Guest >> Configuration >> (Pages)Guest Self-Registration >> select the self-registration page and go to Edit >> Register Page >> Form >>  select the filed visitor_phone and set the Validator to " ISRegexMatch" and enter the above regex in the Validator Argument filed as shown below.
    Note:  Edit the Validation Error as per your requirement.
    Verification
    Adding the given regex will validate the phone number and prevent the guest user from registering the phone number starts with '+' or '0'.
    Please find below the sample outputs for your reference.
    Result when phone number starts with '+' or '0'.
    Successful registration.

    Is this a Mac Preview issue?

Maybe you are looking for

  • Error when fetching a binary value from a resul set

    SQL ERROR CODE: 17002; SQL ERROR MSG: Io exception: Bigger type length than Maximum The above mentioned error occurs when I try to fetch a binary column from a result set. I execute the following statement in my code. byte[] byteArr = jresultset.getB

  • An error occurred accessing a data source.

    Hi, I have seen many posts talking about this error but still i am facing the same issue. The process i have followed is: 1) created infopath form with receive data connection to SQL DB with plain username/pwd 2) placed the repaeating table of receiv

  • Harris Nexio LXF Export in Final Cut X?

    I have a Nexio LXF export plug in for Final Cut 7 that allows me to export files for playback on our Harris broadcast servers. Is there a way to use that same plug in in Final Cut X? It shows up under export in my FCP 7 menu but it does nor appear un

  • 1603 - Fatal error during installation

    Hi all, 3 days ago I got Adobe Creative Cloud with access to all Apps in the Creative Suite. After downloading the Adobe Application Manager I commenced downloads/installs of each of the apps. Nearly half of them have come back saying that "Installat

  • Rows per batch and DefaultbufferMaxrows

    Hi, What is the difference between rows per batch and DefaultbufferMaxrows in data task? Is there any relation between these two?