Is it possible to identify the user?

Hi,
I know that I can check identity.name to see who the user is. But it seems that this property is only available during console, batch, menu and app initialization events.
I have a date that is supposed to auto fill if it is blank. I want it to work on every machine except one, and I want the form to identify the user and if that user is a specific user, the date doesn't auto populate.
If the identity object won't work, can anyone think of another way?
Thanks.

As documented in Adobe's Acrobat JavaScripting Manual, there are security restrictions with respect to the "identity" object. Those restrictions prevent one from directly accessing the "identity" object from a form field. You can access the properties from a folder level JavaScript. The following script when placed in Acrobat's application JavaScript folder will create and initialize application level variables that be accessed by any PDF opened by Acrobat:
// Folder level script to create an application level variables for the "identity" objects properties
var Identity = new Array();
Identity.Corporation = identity.corporation;
Identity.Email = identity.email;
Identity.LoginName = identity.loginName;
Identity.LoginName = identity.loginName;
Identity.Name = identity.name;
One can then add the following document level or field level javaScript to initialize fields within the PDF to the value of the application level variables:
this.getField("loginName").value = Identity.LoginName;
this.getField("name").value = Identity.Name;
this.getField("by").value = "By: ";
this.getField("by").value += Identity.Name;
With version 7.0 or above, you can use a trusted function located as a document level script to retrieve the information:
trustedIdentity = app.trustedFunction( function (sProperty) {
var iProperty = "";
app.beginPriv(); // explicitly raise privilege
iProperty = identity[sProperty];
app.endPriv();
return iProperty;
One can then add the following document level or field level javaScript to initialize fields within the PDF to the value of the application level variables:
this.getField("loginName").value = trustedIdentity("loginName");
this.getField("name").value = trustedIdentity("name");
this.getField("by").value = "By: ";
this.getField("by").value += trustedIdentity("name");

Similar Messages

  • WebForms - Can i make the form user specific. For example can i identify the user who clicked on the link of webform?

    For example can i identify the user who clicked on the link of webform? Because i have a list of users and every time individual needs to select their name.?

    Hi,
    Unfortunately, it is not possible to create a user specific form in  FormsCentral, It is not possible to identify the users who has visited the link.
    Regards,
    Nakul

  • To identify the user running the job at runtime

    Hi All,
    My requirement is to develop a program which need to send mail only if a particular user runs the job.
    I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime.
    Please suggest me the possible ways of identifying the user running the job at runtime.
    Thanks in advance!!!
    Regards,
    Dinesh.

    "I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime."
    This is not true if your program/form/method is called inside the ABAP report which is executing in the batch job step. There, the active SY-UNAME is the user entered in SM36 as the job step user. It is not the user who planned/scheduled the job.
    It is unclear from your description where your program is actually running. Is it another (ABAP) step belonging to the same job or is it actually some routine called within the same job step that you are checking or is it a program totally unrelated to the batch job in question (in that case, check out the other answers about TBTCO/TBTCP)
    - Alex

  • Is that possible to display the user selection data in the printable page?

    Hi All,
    I'm going to add a printablepage button on my page.
    Here comes a questions.
    Is that possible to display the user selection data in the printable page?
    For example,
    I have a table in the page,with 10 records.User select 5 of them.Can I display these 5 records in the printable page?
    Please help.

    Hi Yannick,
    Thanks a lot for the information. It worked.
    The portlet data can be accessible using bindings, but parameter name can be different.
    Meanwhile I have got one more scenario, where the Portlet and Task Flow placed in different pages of WCP Application. On change of data in the Portlet the application should navigate to another page where the Task Flow placed and displays selected data.
    Basically I can not use any button for navigation. The navigation should happen once I do some action in Portlet.
    Is this possible? If yes can you please let me know the steps?
    Thanks in advance!
    Somnath
    Edited by: Somnath Basak on Dec 20, 2011 9:41 AM

  • Is it possible to allow the user to highlight specific label in the GUI.

    i have an existing GUI tt allows user to key in records of information eg, patient records in a hospital system.
    and display them based on wat the user key in for the patient's id no:
    is it possible to allow the user to highlight label in the GUI.
    Label as in information like Illness:<Red>Cancer<Red>
    for tt customer only.
    and re open the file to have the color still there.
    i serialized my vector of objects into a file, and have the gui to retrieve them upon execution.
    color wise i m lost.
    one solution is to have a corresponding Color attribute to each of my other attribute in all my other classes.
    besides this, any idea how to do it?
    i also did a search on java map..
    couldn't really find sth useful abt it..
    seems like few ppl know how to use it well..
    API doesn't seems to show how i can use it to reach my objective.
    anyway, i hope the user can highlight A attribute of a record and not highlight the entire record..
    tt's why i find it soo cumbersome to have another Color object created for each atttribute.
    eg:
    patientId, patientName, etc.....
    thanks in advance

    Several Swing components understand HTML tags, eg JLabel, which is VERY useful, as in the previous example.
    Are you asking "how do I highlight a field" or "how do I make it remember the color it has"?
    As Color is itself Serializable, why not store your data in a Hashtable not a Vector?

  • Is it possible to change the user status of a TECO Order

    Hello Folks
    Is it possible to changes the user status of a TECO Order?
    I have tried to change it using the FM 'STATUS_CHANGE_EXTERN'. Its working fine for NON TECO Orders but not for TECO Orders.
    On the other hand I was able to manually change the user status for a TECO Order in transaction IW32.
    I need to change the user status from NFBK to FBK.
    Please provide some inputs for the same.
    Thanks n Regards
    Ramesh

    The simple way is via the Internationalization settings via ARD or RDP or Screen Sharing, either via System Preferences or (if enabled) via the menu bar. If you're looking for a lower-level approach, there's not AFAIK a direct command for this. As for one possible approach, might [threadID=2106201|http://discussions.apple.com/thread.jspa?threadID=2106201] help?

  • Is it possible to restrict the user from creating a sibling and allow him to ONLY create child nodes in DRM?

    When in a hierarchy, a user right clicks on a node to crate a new node, he has two options
    -Child
    -Sibling
    Is it possible to restrict the user from creating a sibling and allow him to ONLY create child nodes?
    Business cases:
    1. different level nodes need to have different prefixes.
    - Thus, the default prefix property definition uses the level number to assign a prefix
    - Also, a validation, to ensure the correct prefix, uses the level number
    But if the user can create a child and a sibling then the default prefix will only be right for a single case and not both.
    Thanks

    If the images are exactly the same size then make sure the layer with the mask
    is the active layer and in the other documents go to Select>Load Selection and choose
    your document with the layer mask under Source document and under channel choose the layer mask.
    After the selection loads press the layer mask icon at the bottom of the layers panel.
    MTSTUNER

  • How to identify the user who created the variant

    Hi All,
    Can anyone tell me how to identify the user who created the variant ?

    Hi Dear,
    For the same go to SE11 and view the table "VARID". This table give the details of the program,user,variant etc.
    From this table u can know which user created the variant. Hope this solve your purpose.
    Regards

  • I recently lost my iphone 4 and have an iphone3 on loan until I get upgrade in Aug.  I want to sync my data - contacts most important  - from my itunes account...is this possible?  Is it possible to change the user ID on the borrowed phone to my ID?

    I recently lost my iphone 4 and have an iphone3 on loan until I get upgrade in Aug.  I want to sync my data - contacts most important  - from my itunes account...is this possible?  Is it possible to change the user ID on the borrowed phone to my ID?

    There are no contacts in itunes.
    Your contact should be on your computer in whatever program you have selected to sync.  Just sync them to the new one.
    Click Support at the top of this page, then click manuals
    Changing the itunes account on nthe iphone is covered there as is restoring the iphone as new or from backup.

  • How can I make a survey automatically identify the user in the results?

    How can I make a survey automatically identify the user in the results (so that it won't be anonymous)?

    I am not sure what information to provide.  Here is what I am trying to do.  I am trying to create an HR questionnaire with multiple choice questions and several multiline textboxes to capture comments.  I want to send it out by email address and/or embed the questionnaire somewhere on the company's intranet website.  But we don't want the questionnaire to be anonymous. If someone makes a particular comment, we want to be able to communicate with the person who made that particular comment.  How would we be able to trace the person? By email address, or by user ID?

  • Identify the user logged in to the application

    Hi Guys,
    I am trying to integrate APEX(4.0.1) with oracle SSO, using the doc "Corporate Single-Sign On Integration Process"   http://my.oracle.com/site/pdit/BusinessOpsIT/IdentityMgmtSvs/CorporateSSOPartnerApplicationRequest 
    Now that i have installed APEX with EPG (Embedded PL/SQL Gateway), i have tried to integrate sso using the note "562807.1", i was able to successfully authenticate the user, but unfortunately am not able to redirect to application after authentication(goes to a blank page), SR has been raised but couldn't get any further.
    As a work around i have installed APEX using OHS and integrated it with WEBGATE and integrated it with sso (http://my.oracle.com/site/pdit/BusinessOpsIT/IdentityMgmtSvs/webgateHowTo).
    I have used  DAD confg as the APEX level authentication(No Authentication (using DAD)).
    Everything worked successfully, now able to login to the application using Oracle ID, but once logged in to the application am not able to identify the user name, as it shows the APEX_PUBLIC_USER in the APP_USER variable.
    please help me to identify the username logged in to the application.
    Thanks and Regards,
    Harish

    Hi Sean,
    That thread is taking about the UDF and FMS.  If you need get the user name on the PLD, that is necessary first step.  You have to create an UDF first and then assign that FMS query.  After this step, you will be able to put this new field on your PLD.
    Thanks,
    Gordon

  • When I download the installer, it asks me to identify the user. I do, then it closes without installing. How can I fix this?

    When I download the installer, it asks me to identify the user. I do, then it closes without installing. I am using my administrator account, and when I either click on that, or manually enter the info, the installer closes. Really weird, I have used firefox on every computer, and never had this issue

    Hi,
    You can right-click the installer and check the '''Properties''' for the '''Digital Signatures''' of Mozilla. You can download the latest Firefox here: https://www.mozilla.org/en-US/firefox/new/
    Once the digital signature has been verified you can also try to trust/allow the installer and its related files/processes in any and all security software that have such configurations.
    You can also right-click and '''Run as administrator'''. Please see [https://support.mozilla.org/en-US/kb/Installing%20Firefox%20on%20Windows this] and the related links on Windows UAC.

  • Is it possible to limit the user to one session?

    Hi
    We have Oracle apps R 12.0.6, single node installation. Because of performance issues, i want to restrict the user to have only one session. Is it possible to limit the user to one session?
    Regards
    Arizuddin

    Ateeq,
    I tried to load the event and subscription according to metalink document id
    About the oracle.apps.icx.security.session.created business event. [ID 304209.1]. it says file does not exist.How to resolve this?Could you please post the command along with the complete error?
    Regards,
    Hussein

  • Possible to allow the user to navigate to form sections using a dropdown?

    I am designing a realtively long PDF form that has many sections.
    I am hoping that I can create a TAG inside the PDF form that I can reference using drop downs that the free Reader will support
    The desired functionality is :
    User activates drop down - selects the section they want to see if it is not already visible - and the reader moves them to that location -
    so they can read the data at that location -
    Can you please help me by indicating :
    1. Is this possible ?.
    2. Where I can find a useful example for doing something of this sort ?
    Thank You very much

    Fundamentally, you have two possibilities:
    a) create Named Destinations where you want the user to get to, and then make your drop so that the destination name will be defined as return value, so that you can go to it.
    b) define the first field of a section, and put its name as return value in the drop down (aka combo box). Then set the focus to that field.
    HTH.
    Max Wyss.

  • Need a script to update AD information from Excel file, however employee ID is use for identify the user in AD

    Please help me to get this done!....Thanks in Advance
    This is current script I use to update AD record but its taking user id to pick the user in AD, which is some time give error not update properly..
    # UpdateUsers.ps1
    # PowerShell program to update Active Directory users from the information in a
    # Microsoft Excel spreadsheet. Only single-valued string attributes supported.
    # Author: Richard Mueller
    # PowerShell Version 1.0
    # September 12, 2011
    Trap
        If ("$_".StartsWith("Cannot load COM type Excel.Application"))
            "Excel application not found, program aborted"
            Add-Content -Path $LogFile -Value "## Excel application not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If (("$_".StartsWith("Exception has been thrown")) -and ($Step -eq "4"))
            "Excel spreadsheet not found, program aborted"
            Add-Content -Path $LogFile -Value "## Excel spreadsheet not found: $ExcelPath"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The server is not operational"))
            "Domain Controller not found, program aborted"
            Add-Content -Path $LogFile -Value "## Domain Controller not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The directory service is unavailable"))
            "Active Directory not found, program aborted"
            Add-Content -Path $LogFile -Value "## Active Directory not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        If ("$_".StartsWith("The specified domain"))
            "Domain not found, program aborted"
            Add-Content -Path $LogFile -Value "## Domain not found"
            Add-Content -Path $LogFile -Value "   $_"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            Break
        "Unexpected error: $_"
        Add-Content -Path $LogFile -Value "## Unexpected error: $_"
        Add-Content -Path $LogFile -Value "   Step: $Step"
        Break
    Function CleanUp
        Trap
            "Error during cleanup: $_"
            Add-Content -Path $LogFile -Value "## Error during cleanup: $_"
            $Script:Errors = $Script:Errors + 1
            Continue
        # Function to release Excel objects from memory.
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Columns)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Rows)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Range)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Sheet)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Worksheets)} While ($x -gt -1)
        $Workbook.Close($False)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Workbook)} While ($x -gt -1)
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Workbooks)} While ($x -gt -1)
        $Excel.Quit()
        Do {$x = [System.Runtime.InteropServices.Marshal]::ReleaseComObject($Excel)} While ($x -gt -1)
    # Specify paths to spreadsheet and log file.
    $Script:Errors = 0
    $Step = "1"
    $ExcelPath = "c:\scripts\UpdateUsers.xls"
    $LogFile = "c:\scripts\UpdateUsers.log"
    Write-Host "Please Standby..."
    # Add to the log file.
    $Step = "2"
    Add-Content -Path $LogFile -Value "------------------------------------------------" -ErrorAction Stop
    Add-Content -Path $LogFile -Value "UpdateUsers.ps1 Version 1.0 (September 12, 2011)"
    Add-Content -Path $LogFile -Value $("Started: " + (Get-Date).ToString())
    Add-Content -Path $LogFile -Value "Spreadsheet: $ExcelPath"
    Add-Content -Path $LogFile -Value "Log file: $LogFile"
    $Step = "3"
    # Open specified Excel spreadsheet.
    $Excel = New-Object -ComObject "Excel.Application"
    $Workbooks = $Excel.Workbooks
    $Step = "4"
    $Workbook = $Workbooks.Open($ExcelPath)
    $Worksheets = $Workbook.Worksheets
    $Sheet = $Worksheets.Item(1)
    $Range = $Sheet.UsedRange
    $Rows = $Range.Rows
    $Columns = $Range.Columns
    $Step = "5"
    # Hash table of attribute syntaxes.
    # The LDAP display names will be read from the spreadsheet.
    # The corresponding syntaxes will be read from the Schema container.
    $Attributes = @{}
    # Array of spreadsheet column headings.
    $Cols = @()
    $Step = "6"
    # Read attribute LDAP Display Names from the first row of the spreadsheet.
    $ID = 0
    For ($k = 1; $k -le $Columns.Count; $k = $k + 1)
        # Retrieve column heading, the lDAPDisplayName of an attribute.
        $Value = $Sheet.Cells.Item(1, $k).Text
        # Keep track of all column headings.
        $Cols += $Value
        # Skip duplicates in hash table.
        If ($Attributes.ContainsKey($Value) -eq $False)
            # Default is "NotFound", until found in the AD Schema.
            $Attributes.Add($Value, "NotFound")
        # Keep track of which column uniquely identifies users.
        If ($Value.ToLower() -eq "distinguishedname") {$ID = $k}
        If (($Value.ToLower() -eq "samaccountname") -and ($ID -eq 0)) {$ID = $k}
        # This script cannot be used to rename users.
        If ($value.ToLower() -eq "cn")
            Add-Content -Path $LogFile -Value "## This script cannot be used to rename users"
            Add-Content -Path $LogFile -Value "   Do not specify the cn attribute in the spreadsheet"
            Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
            CleanUp
            Return "Program aborted: cn attribute found in spreadsheet" `
                + "`nSee log file: $LogFile"
    $Step = "7"
    If ($ID -eq 0)
        Add-Content -Path $LogFile -Value "## No column found to identify users"
        Add-Content -Path $LogFile -Value "   One column must be distinguishedName or sAMAccountName"
        Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
        CleanUp
        Return "Program aborted: No column found in spreadsheet to identify users" `
            + "`nSee log file: $LogFile"
    # Create filter to query for attributes in the schema.
    $Attrs = $Attributes.Keys
    $Filter = "(&(objectCategory=AttributeSchema)(|"
    ForEach ($Attr In $Attrs)
        $Filter = $Filter + "(lDAPDisplayName=$Attr)"
    $Filter = $Filter + "))"
    $Step = "8"
    $RootDSE = [System.DirectoryServices.DirectoryEntry]([ADSI]"LDAP://RootDSE")
    $Domain = $RootDSE.Get("defaultNamingContext")
    $Schema = $RootDSE.Get("schemaNamingContext")
    $Step = "9"
    # Use the NameTranslate object.
    $objTrans = New-Object -comObject "NameTranslate"
    $objNT = $objTrans.GetType()
    # Initialize NameTranslate by locating the Global Catalog.
    $objNT.InvokeMember("Init", "InvokeMethod", $Null, $objTrans, (3, $Null))
    $Step = "10"
    # Retrieve NetBIOS name of the current domain.
    $objNT.InvokeMember("Set", "InvokeMethod", $Null, $objTrans, (1, "$Domain"))
    $NetBIOSDomain = $objNT.InvokeMember("Get", "InvokeMethod", $Null, $objTrans, 3)
    Add-Content -Path $LogFile -Value "NetBIOS name of domain: $NetBIOSDomain"
    $Step = "11"
    $Searcher = New-Object System.DirectoryServices.DirectorySearcher
    $Searcher.SearchRoot = [ADSI]"LDAP://$Schema"
    $Searcher.PageSize = 200
    $Searcher.SearchScope = "subtree"
    $Searcher.PropertiesToLoad.Add("lDAPDisplayName") > $Null
    $Searcher.PropertiesToLoad.Add("attributeSyntax") > $Null
    $Searcher.PropertiesToLoad.Add("isSingleValued") > $Null
    $Searcher.PropertiesToLoad.Add("systemFlags") > $Null
    # Filter on specified attributes.
    $Searcher.Filter = $Filter
    $Step = "12"
    # Query Active Directory.
    $Results = $Searcher.FindAll()
    # Enumerate recordset.
    ForEach ($Result In $Results)
        # Retrieve properties of attributes.
        $Name = $Result.Properties.Item("lDAPDisplayName")[0]
        $SysFlags = $Result.Properties.Item("systemFlags")[0]
        $SyntaxNum = $Result.Properties.Item("attributeSyntax")[0]
        $SingleValued = $Result.Properties.Item("isSingleValued")[0]
        # Only single-valued string attributes supported by this version of the program.
        Switch ($SyntaxNum)
            "2.5.5.12" {$Syntax = "String"}
            Default {$Syntax = "NotSupported"}
        If ($Name.ToLower() -eq "distinguishedname") {$Syntax = "DN"}
        If (($SysFlags -band 4) -ne 0)
            $Attributes[$Name] = "Constructed"
        Else
            If ($SingleValued -eq $True)
                $Attributes[$Name] = $Syntax
            Else
                $Attributes[$Name] = "NotSupported"
    $Step = "13"
    # Check if any attributes not found or have unsupported syntax.
    $Found = $True
    ForEach ($Attr In $Attrs)
        $Syntax = $Attributes[$Attr]
        If ($Syntax -eq "NotFound")
            Add-Content -Path $LogFile -Value "## Attribute $Attr not found in schema"
            "Attribute $Attr not found in schema"
            $Found = $False
        If ($Syntax -eq "NotSupported")
            Add-Content -Path $LogFile -Value "## Attribute $Attr has a syntax that is not supported"
            "Attribute $Attr has a syntax that is not supported"
            $Found = $False
        If ($Syntax -eq "Constructed")
            Add-Content -Path $LogFile -Value "## Attribute $Attr is operational, so is not supported"
            "Attribute $Attr is operational, so is not supported"
            $Found = $False
    $Step = "14"
    If ($Found -eq $False)
        Add-Content -Path $LogFile -Value $("Program aborted: " + (Get-Date).ToString())
        CleanUp
        Return "Program aborted" `
            + "`nSee log file: $LogFile"
    # Read remaining rows of the spreadsheet, until the first blank value is found
    # in the column that identifies users.
    $Step = "15"
    $Script:Updated = 0
    $Script:Unchanged = 0
    $j = 2
    Do {
        # Retieve ID value for the user first.
        $Value = $Sheet.Cells.Item($J, $ID).Text
        $Found = $False
        $Step = "16"
        If ($Cols[$ID - 1] -eq "distinguishedname")
            # Any forward slash characters must be escaped.
            $DN = $Value.Replace("/", "\/")
            # Bind to the user object.
            # If user not found, $User.Name will be $Null.
            $User = [ADSI]"LDAP://$DN"
            If ($User.Name -ne $Null)
                $Found = $True
        $Step = "17"
        If ($Cols[$ID - 1] -eq "samaccountname")
            Trap
                Write-Host ""
                "Error translating name: $_"
                Add-Content -Path $LogFile -Value "## Error translating name $Value"
                Add-Content -Path $LogFile -Value "   Description: $_"
                $Script:Errors = $Script:Errors + 1
                Continue
            # Convert sAMAccountName to distinguishedName.
            $DN = ""
            $Step = "18"
            $objNT.InvokeMember("Set", "InvokeMethod", $Null, $objTrans, (3, "$NetBIOSDomain$Value"))
            $DN = $objNT.InvokeMember("Get", "InvokeMethod", $Null, $objTrans, 1)
            $Step = "19"
            If ($DN -ne "")
                $Step = "20"
                # Any forward slash characters must be escaped.
                $DN = $DN.Replace("/", "\/")
                # Bind to the user object.
                $User = [ADSI]"LDAP://$DN"
                $Found = $True
        If ($Found -eq $True)
            $Step = "21"
            # Read remaining values for this user.
            $Changed = $False
            For ($k = 1; $k -le $Columns.Count; $k = $k + 1)
                # Skip the identifying column.
                If ($k -ne $ID)
                    $Step = "22"
                    # Retrieve attribute name for this column from array.
                    $AttrName = $Cols[$k - 1]
                    # Retrieve attribute syntax from hash table.
                    $Syntax = $Attributes[$AttrName]
                    $Step = "23"
                    # Retrieve attribute value for this user.
                    $Value = $Sheet.Cells.Item($j, $k).Text
                    # Skip blank values.
                    If ($Value -ne "")
                        If ($Syntax -eq "String")
                            Trap
                                If ("$_".StartsWith("The directory property cannot be found"))
                                    Continue
                                Else
                                    Write-Host ""
                                    "Error retrieving value from Active Directory: $_"
                                    Add-Content -Path $LogFile -Value "## Error retrieving $AttrName for user $DN"
                                    Add-Content -Path $LogFile -Value "   Description: $_"
                                    $Script:Errors = $Script:Errors + 1
                                    Continue
                            $Step = "24"
                            # Single-valued string attribute.
                            # Retrieve existing value.
                            $OldValue = ""
                            $OldValue = $User.Get($AttrName)
                            # Check if existing value to be deleted.
                            If ($Value.ToLower() -eq ".delete")
                                If ($OldValue -ne "")
                                    If ($AttrName.ToLower -eq "samaccountname")
                                        Add-Content -Path $LogFile -Value `
                                            "## Mandatory attribute sAMAccountName cannot be cleared for user: $DN"
                                        $Script:Errors = $Script:Errors + 1
                                    Else
                                        Trap
                                            Write-Host ""
                                            "Error deleting value from Active Directory: $_"
                                            Add-Content -Path $LogFile -Value "## Error deleting $AttrName for user $DN"
                                            Add-Content -Path $LogFile -Value "   Description: $_"
                                            $Script:Errors = $Script:Errors + 1
                                            Continue
                                        $Step = "25"
                                        # Make the attribute value "not set".
                                        $User.PutEx(1, $AttrName, 0)
                                        $Changed = $True
                            Else
                                $Step = "26"
                                # Check if new value from spreadsheet different.
                                If ($Value -ne $OldValue)
                                    Trap
                                        Write-Host ""
                                        "Error assigning value from Active Directory: $_"
                                        Add-Content -Path $LogFile -Value "## Error assigning $AttrName for user $DN"
                                        Add-Content -Path $LogFile -Value "   Description: $_"
                                        $Script:Errors = $Script:Errors + 1
                                        Continue
                                    # Assign the new value to the attribute.
                                    $User.Put($AttrName, $Value)
                                    $Changed = $True
                        Else
                            # Unexpected error.
                            Add-Content -Path $LogFile -Value `
                                "## Unexpected syntax: $Syntax for attribute $AttrName for user $DN"
                            $Script:Errors = $Script:Errors + 1
            If ($Changed -eq $True)
                Trap
                    Write-Host ""
                    "Error saving to Active Directory: $_"
                    Add-Content -Path $LogFile -Value "## Error saving to AD for user $DN"
                    Add-Content -Path $LogFile -Value "   Description: $_"
                    $Script:Errors = $Script:Errors + 1
                    $Script:Updated = $Script:Updated - 1
                    Continue
                $User.SetInfo()
                Add-Content -Path $LogFile -Value "Update user: $DN"
                Write-Host "." -NoNewLine
                $Script:Updated = $Script:Updated + 1
            Else
                Add-Content -Path $LogFile -Value "User unchanged: $DN"
                Write-Host "." -NoNewLine
                $Script:Unchanged = $Script:Unchanged + 1
        Else
            Add-Content -Path $LogFile -Value "## User not found: $Value"
            Write-Host "." -NoNewLine
            $Script:Errors = $Script:Errors + 1
        $j = $J + 1
    } Until ($Sheet.Cells.Item($j, $ID).Text -eq "")
    $Step = "27"
    CleanUp
    Add-Content -Path $LogFile -Value $("Finished: " + (Get-Date).ToString())
    Add-Content -Path $LogFile -Value "Number of users updated: $Script:Updated"
    Add-Content -Path $LogFile -Value "Number of users unchanged: $Script:Unchanged"
    Add-Content -Path $LogFile -Value "Number of errors: $Script:Errors"
    Write-Host ""
    "Done"
    "Number of errors: $Script:Errors"
    "See log file: $LogFile"

    Actually scripts run fine with excel file, currently we are using user-id to pick to update AD. Now we want to update AD use employee id. You can say to identify the record in AD through employee ID instead of user-id. 
    I do not think you will get anyone here to fix that for you.  You need to find someone who knows PowerShell to help you or learn PowerShell your self.
    I would fix it for you but not for free.  It is too oddly designed and has too many dependencies.  Any small change is likely to break it.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • How to change newly registered user name, without changing entire apple id, in iCloud?

    Recently created new user name.  Need to change it.  I do not want to change my entire apple id account information.  The only information I can find in communities, has to do with the previous Mobile Me stuff and not the new iCloud stuff.  Again, I

  • Missing package information on MyBT accounts

    Missing package information on MyBT accounts and after lots of phone call no one can fix it. which department do i need to talk to. and can i have a name of some one it that department so I can look them up in the Directory if not a name a EIN will d

  • Increase Target Rate on Veristand

    Hello, I am a novice user of Veristand. I am trying to make a control feedback using a compactRIO :  RT NI cRIO 9024 Chassis cRIO 9113 Modules 9220 and 9263. I am using Veristand with a compiled model from Simulink to make my control. I want to be ab

  • Generic icons for A - pplications

    Anyone know which cache (or is it something else?) I have to delete or flush etc so that newly installed apps will display their own icons - and not the generic 'A' - in the Finder under 10.5.2, please? Restarting always shows application-specific ic

  • Disable a column in Find Dialog?

    Hi, Is any way to disable/omit a column in Find Dialog without omit it in setQueryInfo? Thx Ali