Exporting AD user info to csv

Please let me know if it is possible to have a list of users exported from the Active Directory to a CSV file with the following fields:
·         Username
·         First Name
·         Last Name
·         Account Status (Enabled/Disabled)
·         Department
·         Job Title
·         Location
·         Phone Number
·         Manager
·         Email Address
As well as a list of all groups and the users that are contained within the group.

On a DC (or with RSAT-AD-Powershell from any server) open Powershell (elevated) and execute:
import-module activedirectory
Get-ADUser -Filter * -Properties SAMAccountName, DisplayName, GivenName, SurName, EmailAddress, Title, Manager, Department, Location, OfficePhone | select SAMAccountName, DisplayName, GivenName, SurName, EmailAddress, Title, Manager, Department, Location,
OfficePhone, @{Name='Status'; Expression={if (get-aduser -filter {(Enabled -eq $true) -and (samaccountname -eq $_.samaccountname)}) {"enabled"} else {"disabled"}}}  | Export-CSV "C:\temp\export.csv"
I think you can also use the property "userAccountControl" to look for enabled/disabled accounts. But that's a bitmask value.

Similar Messages

  • Csvde update user info with csv file

    I see many ways how to do this online but I don't understand how to write the entire script myself from what's being showed online, being it from a video or from another forum - due to everyone else s' methods involves different scenarios.
    I would like know what does my excel/csv file need to look like if I'm updating only each AD object inside an OU with the following:
    TELEPHONE NUMBER, FAX NUMBER, MOBILE NUMBER, TITLE - the other entries are already there, such as web address, email address, display name.
    And then what am I going to add in the command line: CSVDE -i -f mailboxdetails.csv ect?

    I agree with Ed.
    If you have a Windows 2008 R2 AD in place , you can achive this goal by using a .csv file and a script with couple of lines in PowerShell  .
    First create the csv file which must contains the following header and its value  (any other if you want) :
    SamAccountName,Title,FaxNumber,MobilNumber,TelephoneNumber 
    then use the below script :
    Import-Module activeDirectory
    $allusers =Import-Csv c:\users.csv
    foreach($user in $allusers)
    Set-aduser -identity $user.samaccountname -Title $user.title -mobilePhone $user.mobileNumber -Fax $user.faxNumber -add @{TelephoneNumber=$user.telephonenumber }
    Note : just change the .csv file name and it's path .
    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. ---------- MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2

  • Exporting table data to a CSV file

    hello everyone,
    i need help on exporting table data to a CSV file.
    I have a div element containing the table which displays some data.
    there is a "Export" button just above the table, which if clicked, will export the current data in the table to a .csv file.
    can this be done in jsp? or i need to use servlet?
    also how can i submit the table data only? (as my webpage contiain other data also)
    can anyone provide with some sort of sample code?
    thanks in advance!!

    oops!!
    i just forgot..
    when the user will click on the export button, i want to greet him with a "Save As"
    popup, so that he can specify the filename and location to save the file.
    thanks!!

  • ACS 4.0 Supplementary User Info fields.. Can it be extracted?

    Hi,
    I use ACS 4.0 and have used the Supplementary User Info fields on users accounts to create a Staff Number field under each uers account. I have a requirement to extract this from the ACS internal database but the csutil.exe doesn't seem to do this when I do a -d. Has anyone encountered this before and can show me the light?
    Regards,
    RS

    Yes, aaa-reports! can import the ACS db. Once imported there are canned reports on its content. Also our query builder allows you to search/filter/group/export the user data.
    The trial version allows you to import 50% of your groups & users.
    Darran

  • Export AD group members to csv powershell with full details

    Hi,
    please help me...
    How to Export AD group members to csv powershell with full details
    fasil cv

    Yep, that's true. Even if we try:
    $GroupName = "group1"
    Get-ADGroupMember -Identity $GroupName | where { $_.objectClass -eq "user" } | % {
    Get-ADUser -Identity $_.distinguishedName -Properties * | select * |
    Export-Csv -Path "$GroupName.csv" -NoTypeInformation -Append -Force
    By scoping the Get-ADGroupMember to user objects, we may still have mismatched columns since some users may have properties that others do not; like 'isCriticalSystemObject'
    I suppose one solution is to enumerate the properties before the Export, and add the consistent ones to a custom PSObject, and export that to CSV. It would help if the task requirement specifies what user properties are needed instead of the blanket "full
    details", or if we export to XML instead of CSV.
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    Filtering the object type to just user objects is already implicit in Get-ADUser. If you really want information on all the members you'll need to run Get-ADUser on the user objects, and Get-ADGroup on the group objects.
    Edit: There might also be computer account objects in there, too.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • BB Curve 8310 - Message -"Unable to look up the user info in database"

    Have contacts with email address uploaded from older model. Receive emails ok...have also set up two addresses for myself, however when trying to either manually place the email address or select one from my contacts, I get the response
    "Unable to look up the user info in database" when trying to send email
    I have created a CSV file for my contacts to transfer to the Curve however I don't know where to go from there. 

    Unable to look up the user info in database - KB03414
    SOLUTION HERE.
    If your issue is resolved, put a checkmark in the green box that contains the resolution.
    OR
    If it was just/or also really helpful - Give it a Kudos.. Go on Mate.. Help the rest of the clueless blackberry user world find their answer too..
    ~Gday from Down Under~

  • How to access a Portal User Info from a J2EE application?

    Hi,
    I have deployed a j2ee application in portal and its running fine.
    from that application i need to assign some roles to some users.i have the user id.
    so my doubt is can i access the portal user info from this j2ee application?i have some servlets in the j2ee application....can i get the portal user info from this servlet?
    plz help me
    regards,
    Visweswar

    Hi,
    Please check out this to get the portal user information from Java -
    WdClientUser class/Interface to aciehve this.
    Please check out these links on the same -
    WDClientUser.getClientUser IUser
    help needed
    Regards
    Lekha

  • How do i export my contacts into a csv file?

    I need to export my contacts into a csv file - Apple support says it can't be done.  Any suggestions anyone please?

    or -> http://lmgtfy.com/?q=Mac+OS+export+contacts+to+CSV

  • How can we export table data to a CSV file??

    Hi,
    I have the following requirement. Initially business agreed upon, exporting the table data to Excel file. But now, they would like to export the table data to a CSV file, which is not being supported by af:exportCollectionActionListener component.
    Because, when i opened the exported CSV file, i can see the exported data sorrounded with HTML tags. Hence the issue.
    Does someone has any solution for this ... Like, how can we export the table data to csv format. And it should work similar to exporting the data to excel sheet.
    For youre reference here is the code which i have used to export the table data..
    ><f:facet name="menus">
    ><af:menu text="Menu" id="m1">
    ><af:commandMenuItem text="Print" id="cmi1">
    ><af:exportCollectionActionListener exportedId="t1"
    >title="CommunicationDistributionList"
    >filename="CommunicationDistributionList"
    >type="excelHTML"/> ---- I tried with removing value for this attribute. With no value, it did not worked at all.
    ></af:commandMenuItem>
    ></af:menu>
    ></f:facet>
    Thanks & Regards,
    Kiran Konjeti

    Hi Alex,
    I have already visited that POST and it works only in 10g. Not in 11g.
    I got the solution for this. The solution is :
    Use the following code in jsff
    ==================
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="text/csv; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    OR
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="application/vnd.ms-excel; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    And place this code in ManagedBean
    ======================
    > public void test(FacesContext facesContext, OutputStream outputStream) throws IOException {
    > DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    >DCIteratorBinding itrBinding = (DCIteratorBinding)dcBindings.get("fetchDataIterator");
    >tableRows = itrBinding.getAllRowsInRange();
    preparaing column headers
    >PrintWriter out = new PrintWriter(outputStream);
    >out.print(" ID");
    >out.print(",");
    >out.print("Name");
    >out.print(",");
    >out.print("Designation");
    >out.print(",");
    >out.print("Salary");
    >out.println();
    preparing column data
    > for(Row row : tableRows){
    >DCDataRow dataRow = (DCDataRow)row;
    > DataLoaderDTO dto = (DataLoaderDTO)dataRow.getDataProvider();
    >out.print(dto.getId());
    >out.print(",");
    >out.print(dto.getName());
    >out.print(",");
    >out.print(dto.getDesgntn());
    >out.print(",");
    >out.print(dto.getSalary());
    >out.println();
    >}
    >out.flush();
    >out.close();
    > }
    And do the following settings(*OPTIONAL*) for your browser - Only in case, if the file is being blocked by IE
    ==================================================================
    http://ais-ss.usc.edu/helpdoc/main/browser/bris004b.html
    This resolves implementation of exporting table data to CSV file in 11g.
    Thanks & Regards,
    Kiran Konjeti

  • Error while exporting one user

    Hi all,
    While Exporting on user in Oracle 9.2.0.1 i am getting this error:
    EXP-000008 ORACLE error 600 encountered.
    ORA-00600: internal error code,arguments: [12811], [41965],[]
    ORA-06512: at "SYS.DBMS_EXPORT_EXTENSION", line 248
    ORA-06512 : at line 1
    EXP-00000: Export terminated unsuccssfully
    But this error message comes only for one user not for others.
    Please suggest the solution for this problem.
    Thanks in advance,
    Vipin

    This is a known 9i bug,
    Bug# 2443896, it is documented here --> Metalink Note 2443896.8
    OERI:[12811] from concurrent SELECT and DDL (DROP) with SQL_TRACE=TRUE
    This bug was fixed in 9.2.0.2.0. I strongly suggest you to apply tha last patchset available. Since the terminal patchset available for 9iR2 is 9.2.0.8.0 you will prevent to hit known bugs up to this version.
    This is just my personal recommendation, but Oracle Support Services has the last word on this issue.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Getting the User Info while Invoking the Process

    Hi All,
        We have created few processes and are working fine.. Now we got a new request to enable the Site Minder authentication for each request. In our project the LiveCycle process is getting invoked from a Flex code via SOAP end point. Flex application is authenticating the request by reading the info from the request object sent by the Site Mider. Is there a way in LiveCycle process to read information from the browser request object? Our application is not linked with LDAP. We wanted to know the user id that was passed as part of the Site Minder authentication and use it in the rest of the services.
        Thank you for your time and help..
    Regards
    Srini

    Jasmin,
             Thank you for your reply. What you are saying is, the Parent app which is invoking the LiveCycle process needs to read the Request object and then pass the user info to the LiveCycle process.
             So we do not have a way to read the browser cookie information from the LiveCycle process. Just want to confirm..
    Thanks
    Srini

  • Logged-in user info doesn't display after the user updates their info

    I created 2 pages. Page 1 has a recordset that displays only the users username and password, I did a filter on this recordset as username = session var = MM_Username. when they click update, which is just a link to page 2, they go to page 2 which has a recordset that filters their user info the same way and allows them to update their username and password. I used an update behavior on this page as well. So, when the user updates their info it DOES change the database info and works great.
    The problem: When the user goes back to page 1 to see their updated username and password that they just updated, it is BLANK. no info displays on screen, even when I refresh the page. it's if the MM_Username var is not refreshing while logged-in. Because when the user logs out and logs back in, it DOES display new username and password on page 1.
    Now it DOES work when I take the filter off of page 1's recordset, but this won't do me any good b/c the user should of course only see their info.
    I am running DW CS3, php, and mysql.
    Please Help! thanks.

    PAGE 1
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", 
    $theNotDefinedValue = "")
       $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : 
    $theValue;
       $theValue = function_exists("mysql_real_escape_string") ? 
    mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
       switch ($theType) {
         case "text":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;
         case "long":
         case "int":
           $theValue = ($theValue != "") ? intval($theValue) : "NULL";
           break;
         case "double":
           $theValue = ($theValue != "") ? "'" . doubleval($theValue) . 
    "'" : "NULL";
           break;
         case "date":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;
         case "defined":
           $theValue = ($theValue != "") ? $theDefinedValue : 
    $theNotDefinedValue;
           break;
       return $theValue;
    $colname_rsUpdateUser = "-1";
    if (isset($_SESSION['MM_Username'])) {
       $colname_rsUpdateUser = $_SESSION['MM_Username'];
    mysql_select_db($database_kh_space, $kh_space);
    $query_rsUpdateUser = sprintf("SELECT username, parentEmail FROM users 
    WHERE username = %s", GetSQLValueString($colname_rsUpdateUser, "text"));
    $rsUpdateUser = mysql_query($query_rsUpdateUser, $kh_space) or 
    die(mysql_error());
    $row_rsUpdateUser = mysql_fetch_assoc($rsUpdateUser);
    $totalRows_rsUpdateUser = mysql_num_rows($rsUpdateUser);
    ?>
    PAGE 2
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", 
    $theNotDefinedValue = "")
       $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : 
    $theValue;
       $theValue = function_exists("mysql_real_escape_string") ? 
    mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
       switch ($theType) {
         case "text":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;
         case "long":
         case "int":
           $theValue = ($theValue != "") ? intval($theValue) : "NULL";
           break;
         case "double":
           $theValue = ($theValue != "") ? "'" . doubleval($theValue) . 
    "'" : "NULL";
           break;
         case "date":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;
         case "defined":
           $theValue = ($theValue != "") ? $theDefinedValue : 
    $theNotDefinedValue;
           break;
       return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
       $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
       $updateSQL = sprintf("UPDATE users SET username=%s, password=%s 
    WHERE userId=%s",
                            GetSQLValueString($_POST['username'], "text"),
                            GetSQLValueString($_POST['password'], "text"),
                            GetSQLValueString($_POST['userId'], "int"));
       mysql_select_db($database_kh_space, $kh_space);
       $Result1 = mysql_query($updateSQL, $kh_space) or die(mysql_error());
       $updateGoTo = "confirmation.php";
       if (isset($_SERVER['QUERY_STRING'])) {
         $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
         $updateGoTo .= $_SERVER['QUERY_STRING'];
       header(sprintf("Location: %s", $updateGoTo));
    $colname_rsUpdateUser = "-1";
    if (isset($_SESSION['MM_Username'])) {
       $colname_rsUpdateUser = $_SESSION['MM_Username'];
    mysql_select_db($database_kh_space, $kh_space);
    $query_rsUpdateUser = sprintf("SELECT userId, username, password, 
    parentEmail FROM users WHERE username = %s", 
    GetSQLValueString($colname_rsUpdateUser, "text"));
    $rsUpdateUser = mysql_query($query_rsUpdateUser, $kh_space) or 
    die(mysql_error());
    $row_rsUpdateUser = mysql_fetch_assoc($rsUpdateUser);
    $totalRows_rsUpdateUser = mysql_num_rows($rsUpdateUser);
    ?>

  • Creating a new webpage using PhP based on user info

    Hey all! I'm going to try and explain this the best I can, I dont think it's too complicated but we'll see
    On my website, what I want to have happen is when a user registers (First name, last name. username, password, email) and hits the "register!" buttton, a new webpage is created that has all of the users info displayed (well, almost everything )
    example is someone browses to my website at www.slaughtergaming.com , goes to my register page, and creates an account with the name 'nyius'. a webpage is then created using the users username (so something like www.slaughtergaming.com/nyius) in which anyone can visit and see all of my info (username, first and lastname, email, etc)
    I hope that pretty much sums it up.. if you need some code from my website ill be glad to poste it

    Yes that could work i suppose ^^
    how would I check to see which user is viewing the page, then load all of the relavent users info?
    Right now when the user logs in, their username and password is saved in the session, so I assume i just need some script that checks who is logged in and then load their info respectively?

  • When to export a numbers file to csv the minus signs don't work with R

    Friends,
    I have trouble getting the statistic program R to read my exported CSV-files from Numbers.
    The minus sign doesn't work, R reads it as a factoric input rather than numeric.
    Does anyone have a tip how to reformat this?
    Jocke

    Wayne, actually, I'm not sure but I think that factoric - or factorial is the denomination that R uses to say that somthing is rather a text than a numeric number - I'm pretty new to R.
    But, anyway, we solved the problem but in a lillte bit of an awkward way.
    The problem is that the minus sugns in numbers is percieved as dashes in R
    (http://www.R-project.org, a free-ware statistical analysis program)
    So where there is a numeric input with a minus sign R thinks it is a letter rather than a number.
    We solved it by exporting the numbers file to CSV, opened it in text editor, copied the suspisios minus sign and pasted it into the search field to find all dashes/minus sign that didn't work and replaced them with a minus sign. After this operation, nothing different could be seen in the text but R saw the difference.
    So this makes it difficult to explain by posting a screenshot - it looks the same but it isn't.
    The funny thing is that the dashes that numbers use when to express a date are percieved as minus signs by R.
    Can anyone understand what I tried to explain? And if so, is there a simpler way to do this? We have a lot of minus signs to export to R.....
    best regard
    Joachim

  • JAAS LoginModule j_security_check and user info

    Hello there,
    I successfully implemented custom LoginModule which validates users against passwords stored in database by calling some server api's. I am using container managed security via j_security_check servlet.
    This is working fine, now I just wonder what is the best way to store additional information about user like name, surname email and make them accessible to JSP/JSF pages.
    I did not found any link from LoginModule to HttpSession so I am stuck on this. Ideally I would like to store this additional info immediately after user is successfully authenticated by LoginModule.
    Any hint on this?
    ferdo

    Frank, thanks for comments.
    Yes user info is in the sama database so I can get it from there, but I would like to call this DB function once after succesfull authentication. In addition we have kind of 2 level passwords in place, one application password and one internal db password for user to access database resources.
    User does not know his/her db password, we have just api to get db password after authentication and existing application api (developed for forms client originaly) assumes user access db by his own connection, so in many api's oracle function user is stored in some tables.
    So what I need is after authentication of user (with application password) I can get Oracle password and then make new DB connection to all application api, just would like to store Oracle password (or new user db connection )somewhere so I dont need to fetch it everytime I need to call application API.
    ferdo

Maybe you are looking for