C# Code that can add user directly to the AD through custom share Point form

Hi
Here is my requirement. Can anyone resolve??? 
Trying to build a Visual web Part in which system administrator can add user directly to the AD through custom share Point form.
Please help in doing this...

Hi
Use DirectoryEntries.Add Method
https://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentries.add.aspx
Or
www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C
Or.
www.morgantechspace.com/2013/10/create-new-active-directory-user-in-c.html?m=1
Regards, Rajendra Singh If a post answers your question, please click Mark As Answer on that ost and Vote as Helpful http://sharepointundefind.wordpress.com/

Similar Messages

  • How to get the users list that can Add/Remove or modify Vendors in Oracle?

    How to get the users list that can Add/Remove or modify Vendors in Oracle?
    I need to generate a report like name and responsibility. Thanks

    That query gives the Supplier information.
    But what i would be needing is to find out the USERS in oracle who can Add/Modify or Remove Vendors.
    I assume it should be based on the Responsibility.

  • I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing. Thanks, Tommy

    I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy

    // create the user profile, get the handle back,
    // and set the membership profile attributes.
    ProfileAdmin newProfile = null;
    try {
    // the users profile name is the domain      
    // he belongs to plus their userName
    // you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
    String profileName = domain_name + "/" + user;
         if (debug.messageEnabled()) {
    debug.message("creating profile for " + profileName);
    // create the user profile object
    newProfile = ProfileManager.createProfile(
    getSession(), profileName ,Profile.USER);
    UserProfile userProfile = (UserProfile)newProfile;
         // set the role the user is a member of. Default is to set
         // the users to the default role of the domain they surfed to
         StringBuffer roleName = new StringBuffer(64);
    // request.domain instead of domain_name if your doing this from a servlet ..
    Profile dp = getDomainProfile(domain_name);
    roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
         if (debug.messageEnabled()) {
    debug.message("setting role for " + user + " = " + roleName);
    userProfile.setRole(roleName.toString());
    newProfile.store(false);
    } catch (ProfileException pe) {
         debug.error("profile exception occured: ",pe);
    return;
    } catch (ProfileException pe) {
         debug.error("login exception occured: ",le);
    return;
    HTH ..

  • Need to format a vpn log text file into a format that can be written directly to a SQL table

    I am trying to do two thing inside of powershell
    1. Take a vpnlog text file  "C:\temp\ps3\vpnlogs\testlog.txt" formatted as such and be able to directly add the columns to a sql table
    "Number" "Date" "Time" "Interface" "Origin" "Type" "Action" "Service" "Source Port" "Source" "Destination" "Protocol" "Rule"
    "Rule Name" "Current Rule Number" "User" "Information" "Product" "Source Machine Name" "Source User Name"
    "291" "29Nov2013" "23:59:00" "" "A*****" "Log" "Log In" "" "" "111.*.*.* " "A*****" "" "" "" "" "pet*******"
    "VPN internal source IP: 192.*.*.*; reason: disconnected from gateway" "Security Gateway/Management" "" ""
    2. Remove the empty colums in this text file so that I can then find a way to upload only colums that have a column name directly up to the sql table via a powershell script .
    SO basically import txt file format it into colums that have data that can then be directly written to a sql table without me having to manually create the columns in the table. if this worked correctly the sql table would be uploaded with the colums and
    data from sql.
    I can do the upload portion with the below listed powershell command however when I import the following file into powershell I have to manually import the testlog.txt into excel then save as a csv to upload... not to mention I had to
    manually create the columns in the sql table so that it imports correctly.
    get-content "C:\temp\ps3\vpnlogs\testlog.txt" I can not get the data to format correctly without manually importing it into the logfiledata.csv.
    $dt=Import-Csv-Path"C:\temp\ps3\vpnlogs\logfiledata.csv"|Out-DataTable
    Write-DataTable -ServerInstance"myserver"-Database"mydata"-TableName"dbo.VPNLOGS"-Data$dt
    I also have tried this to format the text file but it's not working the way I thought it should, but I don't want to have to create the .CSV file if I can avoid it I would rather take the data in powershell formatted and use the colums to
    get-content"C:\temp\ps3\vpnlogs\testlog.txt"|Foreach-Object{
    ($_ 
    -replace'"',',')
    } |Set-Content"C:\temp\ps3\vpnlogs\testlog2.csv"
    | Import-Csv
    "C:\temp\ps3\vpnlogs\testlog2.csv"|selectNumber,date,time,interface,origin,type,action,service,"source
    port",source,destination,protocol,rule,"rule
    name","current
    rule number",user,information,product,"source
    machine name","source
    user name"
    "Number" "Date" "Time" "Interface" "Origin" "Type" "Action"
    "Service" "Source Port" "Source" "Destination" "Protocol" "Rule" "Rule Na
    me" "Current Rule Number" "User" "Information" "Product" "Source Machine Name" "Source User Name"
    "473" "4Dec2013" "23:59:01" "" "AAMESXF604" "Log" "Log In" "" "" "ip72-198-30-53.ok.ok.cox.net" "AAMESXF604" "" "" ""
    "" "usthompst"

    Thank you Mjolinor this seems to have given me a good output, now do you know of a method using the out-datable  and write-datatable that I can use to directly upload the objects and data. Really I do not want to have to create another file at this
    point I would like to take all of this info and now write it directly to my SQL-Table...
       TypeName: Selected.System.Management.Automation.PSCustomObject
    Name                MemberType   Definition                                                                                       
    Equals              Method       bool Equals(System.Object obj)                                                                   
    GetHashCode         Method       int GetHashCode()                                                                                
    GetType             Method       type GetType()                                                                                   
    ToString            Method       string ToString()                                                                                
    Action              NoteProperty System.String Action=Log In                                                                      
    Current Rule Number NoteProperty System.String Current Rule Number=                                                               
    Date                NoteProperty System.String Date=4Dec2013                                                                      
    Destination         NoteProperty System.String Destination=******                                                          
    Information         NoteProperty System.String Information=VPN internal source IP: *.*.*.*; reason: disconnected from gateway
    Interface           NoteProperty System.String Interface=                                                                         
    Number              NoteProperty System.String Number=473                                                                         
    Origin              NoteProperty System.String Origin=********                                                                  
    Product             NoteProperty System.String Product=Security Gateway/Management                                                
    Protocol            NoteProperty System.String Protocol=                                                                          
    Rule                NoteProperty System.String Rule=                                                                              
    Rule Name           NoteProperty System.String Rule Name=                                                                         
    Service             NoteProperty System.String Service=                                                                           
    Source              NoteProperty System.String Source=ip*-*-*-*.ok.ok.cox.net                                                
    Source Machine Name NoteProperty System.String Source Machine Name=                                                               
    Source Port         NoteProperty System.String Source Port=                                                                       
    Source User Name    NoteProperty System.String Source User Name=                                                                  
    Time                NoteProperty System.String Time=23:59:01                                                                      
    Type                NoteProperty System.String Type=Log                                                                           
    User                NoteProperty System.String User=*******  

  • Before installation of "flasplayer 13x32" recieved Security message re" it being an executable file that may contain viruses and codes that can corrupt my computer".

    Downloaded "flashplayer 13x32". A security message appeared from Microsoft "This is an executable file and may contain viruses or codes that will harm your computer". Question: If its corrupted, why did Adobe Website download it.??

    "This is an executable file and may contain viruses or codes that will harm your computer".
    The keyword is "MAY"...
    NOWHERE in that does it say "This is a virus."
    What you're seeing is a standard Windows warning about ANY executable file you can download.
    Adobe isn't, and never has been, in the business of making malware. That said, there are literally millions of fake downloads of things like Reader, Shockwave and Flash Player.
    Bottom line: If you don't trust the download... DON'T USE the download.
    There are two sources to trust for Adobe freeware:
    For Flash Player - Adobe Flash Player Distribution | Adobe
    For Reader - Adobe - Adobe Reader Distribution
    You can bookmark those links and use them ANY time you get an update notification, to know you're getting the download directly from the source.

  • How many T code we can add to any single role?

    Dear Friends,
    How many T code we can add to any single role?
    regards,
    Sachin

    Hi Sachin,
    The catch here is not the Max limit of tCodes, but the Objects that get assigned to the role due to this addition. If they are huge number of Tcodes assigned to a role, the same would be the case with objects. i have typically added 600 + tcodes to roles at times and ) i had no chance to go beyond that limit.
    With SOX and SOD matrixes in place, i hardly have seen max Tcode number crossing 200+ at times where we break responsibiolities into small single roles.
    Hope the info helps.
    Br,
    Sri
    Award points for helpful answers

  • How can I find the user that created a user account and the user who last updated the account

    How can I find out who created a user account and who last updated the account. I think that this is the same information that is displayed in the description field on the General tab.
    I am using ADO commands and vbscript
    ug3j

    I should point out that there are two attributes of all AD objects that can help you track down the correct information in the system logs. These are the whenCreated and whenChanged attributes. This will tell when the object was created and when it was last
    modified, which should help when you search the logs. Also, while whenCreated is replicated to all DC's, so they will all have the exact same creation time, the whenChanged attribute is technically not replicated. The date/time on each DC reflects when
    the last modification was replicated to that DC. The values will differ slightly on each DC, reflecting how long it took for the change to replicate.
    Richard Mueller - MVP Directory Services

  • I installed Adobe Photoshop Elements 11 in my computer before. Right now I'm not using that computer anymore and want to re-install the software to a new computer. I still have the redemption code. Can you please provide me the download link or which ever

    I installed Adobe Photoshop Elements 11 in my computer before. Right now I'm not using that computer anymore and want to re-install the software to a new computer. I still have the redemption code. Can you please provide me the download link or which ever way I can re-install the software to the new computer? Thank you.

    Hi,
    Please go to the link below to download Photoshop elements 11
    http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html
    To get your serial number from redemption code click on the link below
    https://redeem.licenses.adobe.com/getserial/s/redeem
    Thank you,
    Mohd. Naseem

  • Java Code  that can find all the specified functions in a sql statement

    If i pass a string like
    SELECT CONCAT(region_name,store_name) , length( region_name) , region_name || store_name, region_name, store_name FROM Geography
    WHERE store_name = 'Boston';
    Then my code should return
    CONCAT(region_name,store_name)
    length( region_name)
    region_name || store_name
    i.e all function related stuff. Is there any parser in java that can parse all the functions a sql or ny code that can d that. Any help is highly appreciated

    I suspect a regular expression may be able to handle this, or 'grep'. Why do you need to do it in Java?

  • Why can't I add appointments to the calendar anymore?  I can add to my iPad and they show up and sync with iPhone but I can't add appointments directly to the iPhone calendar.

    Why can't I add appointments to the calendar anymore?  I can add to my iPad and they show up and sync with iPhone but I can't add appointments directly to the iPhone calendar.  I am on the latest OS version available for iPhone 5s.

    Hi,
    You cannot manually manage music with match turned on on your iOS device. If you want to manage music manually, you will need to turn off match on your iPhone.
    Jim

  • I need a BAPI or function that can create a PO without the purchase req.

    I need a BAPI or function that can create a PO without the reference to a purchase requisition. We are creating "direct POs" (with no reference to PR) manually. And we have a large amount of documents to create. I can't figure out if BAPI_PO_CREATE and BAPI_PO_CREATE1 can help us by doing this, because I've understood this BAPIs creates POs only with the reference to a purchase requisition.
    Thanks in advance!!
    Sebastian

    Sorry I'm late guys, I couldn't replay your posts because I was busy.
    Charlie,
    ...just because we have the data already in the SAP system.
    My client doesn't want purchase requisitions to be created from the PM orders. Instead he asked us to create the purchase workflow by generating direct purchase orders from the PM orders, basically taking the information from the purchase agreement within the order's tasks. Maybe you don't understand a bit what I'm saying, but let me get this straight: we can't use LSMW because data doesn't come from a legacy.
    Ian,
    ...after all, and like you've said, we're gonna use BAPI_PO_CREATE1 for creating the POs. Today I finally realized that, purchase requisitions aren't mandatory for the bapi to perform the process. If something goes wrong, I'll let you know.
    Thanks anyway for your attention.
    Sebastian

  • UDF in documents lines that can be Change after adding the doc.

    Dear all
    How can i create a UDF in documents lines that can be change after adding the doc? He need to mark some of the lines to already audit or not audit and the date of the action.
    Kind Regards
    Margarida

    It also depends on what documents you are wanting to add these comments to. On documents such as the A/R Invoice/ Delivery, and A/P Invoice/ Goods Receipt PO you cannot change the UDFs on the line item after the document is added (regardless of whether the document is closed). Sales Orders/ Quotes and Purchase Orders line item UDFs can be changed as long as the line hasn't been closed (or partially received/delivered/invoiced).
    Hopefully that makes sense. I could give more of an explanation if I knew what documents you were wanting to add these line item comments to.

  • Recently lost videos from my photo albums. It appears any video that wasn't uploaded directly to the ipad is now missing. They were definitely available prior to say two months ago. I've had the ipad since March. Any ideas why? Looking to reload manually

    Had current ipad since March. Recently videos (in photos app) that were able to be viewed are now missing. The commonality is that they were videos that were not uploaded directly to the ipad. Anything that I've uploaded since March is still accounted for. Just strange because I have viewed these videos since using this ipad. Only recently have they been "removed." WIll try to manually load them back, but any thoughts as to why? Thanks

    If the videos were not uploaded to the iPad - (and I'm never sure what that means to another user - synced from iTunes?)- and they were taken with the iPad itself, you will have to restore from a backup in order to recover the videos if they are really gone from the device.
    If they are purchased videos and they are in your iTunes library, sync them back to the iPad.
    How to backup and restore from a backup
    http://support.apple.com/kb/HT1766

  • System Image Restore Fails "No disk that can be used for recovering the system disk can be found"

    Greetings    
                                        - Our critical server image backup Fails on one
    server -
    Two 2008 R2 servers. Both do a nightly "Windows Server Backup" of Bare Metal Recovery, System State, C:, System Reserved partition, to another storage hard drive on the same machine as the source. Active Directory is on the C: The much larger D: data
    partition on each source hard drive is not included.
    Test recovery by disconnecting 500G System drive, booting from 2008R2 Install DVD, recovering to a new 500G SATA hard drive.
    Server A good.
    Server B fails. It finds the backed-up image, & then we can select the date we want. As soon as the image restore is beginning and the timeline appears, it bombs with "The system image restore failed. No disk that can be used for recovering the system
    disk can be found." There is a wordy Details message but none of it seems relevant (we are not using USB etc).
    At some point after this, in one (or two?) of the scenarios below, (I forget exactly where) we also got :
    "The system image restore failed. (0x80042403)"
    The destination drive is Not "Excluded".
    Used   diskpart clean   to remove volumes from destination drive. Recovery still errored.
    Tried a second restore-to drive, same make/model Seagate ST3500418AS, fails.
    Tried the earliest dated B image rather than the most recent, fail.
    The Server B backups show as "Success" each night.
    Copied image from B to the same storage drive on A where the A backup image is kept, and used the A hardware to attempt restore. Now only the latest backup date is available (as would occur normally if we had originally saved the backup to a network location).
    Restore still fails.         It looks like its to do with the image rather than with the hardware.
    Tried unticking "automatically check and update disk error info", still fail.
    Server A  SRP 100MB  C: 50.6GB on Seagate ST3500418AS 465.76GB  Microsoft driver 6.1.7600.16385   write cache off
    Server B  SRP 100MB  C: 102GB  on Seagate ST3500418AS 465.76GB  Microsoft driver 6.1.7600.16385   write cache off
    Restore-to hard drive is also Seagate ST3500418AS.
    http://social.answers.microsoft.com/Forums/en-US/w7repair/thread/e855ee43-186d-4200-a032-23d214d3d524      Some people report success after diskpart clean, but not us.
    http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/31595afd-396f-4084-b5fc-f80b6f40dbeb
    "If your destination disk has a lower capacity than the source disk, you need to go into the disk manager and shrink each partition on the source disk before restoring."  Doesnt apply here.
    http://benchmarkreviews.com/index.php?option=com_content&task=view&id=439&Itemid=38&limit=1&limitstart=4
    for 0x80042403 says "The solution is really quite simple: the destination drive is of a lower capacity than the image's source drive." I cant see that here.
    Thank you so much.

    Hello,
    1. While recovering the OS to the new Hard disk, please don't keep the original boot disk attached to the System. There is a Disk signature for each hard disk. The signature will collide if the original boot disk signature is assigned to the new disk.
    You may attach the older disk after recovering the OS. If you want to recover data to the older disk then they should be attached as they were during backup.
    2. Make sure that the new boot disk is attached as the First Boot disk in hardware (IDE/SATA port 0/master) and is the first disk in boot order priority.
    3. In Windows Recovery Env (WinRE) check the Boot disk using: Cmd prompt -> Diskpart.exe -> Select Disk = System. This will show the disk where OS restore will be attempted. If the disk is different than the intended 2 TB disk then swap the disks in
    correct order in the hardware.
    4. Please make sure that the OS is always recovered to the System disk. (Due to an issue: BMR might recover the OS to some other disk if System disk is small in size. Here the OS won't boot. If you belive this is the case, then you should attach the
    bigger sized disk as System disk and/or exclude other disks from recovery). Disk exclusion is provided in System Image Restore/Complete PC Restore UI/cmdline. 
    5. Make sure that Number and Size of disks during restore match the backup config. Apart from boot volumes, some other volumes are also considered critical if there are services/roles installed on them. These disks will be marked critical for recovery and
    should be present with minimum size requirement.
    6. Some other requirements are discussed in following newsgroup threads:
    http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/871a0216-fbaf-4a0c-83aa-1e02ae90dbe4
    http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/9a082b90-bd7c-46f8-9eb3-9581f9d5efdd
    http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/11d8c552-a841-49ac-ab2e-445e6f95e704
    Regards,
    Vikas Ranjan [MSFT]
    ------- This information is provided as-is without any warranties, implicit or explicit.-------

  • How can I deauthorize a computer that can no longer connect to the internet or is no longer working ?

    How can I deauthorize Itunes on a computer that can no longer connect to the internet or is no longer working ?

    You can't, which shouldn't be a problem unless you have 4 other computers authorized with the iTunes account and you need to authorize another.
    Once you have authorized 5 computers, you can de-authorize all computere from a computer that is currently authorized followed re-authorizing the current active computers that need to be authorized.

Maybe you are looking for