Identify the user session

Hi. There is a well known way to identify a "user" in the Servlet by using the Session object and the SessionID, even if the user has not loged in by Jaas.
But outside the Servlet scope (in an EJB for instance) how can I know that information?
By using jndi I can discover Who is the Principal, what can help when the user has identified himself.
Thanks

sessionContext.getCallerPrincipal()

Similar Messages

  • Is it possible to start JSON Service specific to the user session?

    Is it possible to make JSON service to start different sessions of BusinessLogic Code in short - Is it possible to start JSON Service specific to the user session?
    Here is what I'm trying to do. I have a created a Configuration Model which contains the business logic. I want to start this model as a JSON service, and the user will interact with this model via mobile App developed using ADF Mobile. The JSON sevice has two calls
    /startConfiguration/{model_id}
    /getConfiguration
    Both of them return the string that indicates the BusinessModel being started by JSON service.
    When invoked " /startConfiguration/{model_id} " from two different browsers (Chrome - started first, FF - started second) for the same model_id (simulating the scenario of two user accessing same model), it did returned two different 'configuration' object strings, indicating that each call started its own Configuration.
    However, when I validated that the session started is user specific by calling "/getConfiguration"  it return same 'configuration object string - which is the second call from FF. Thus indicating that I cannot have JSON service tied individually to each user session. 
    My goal is to have JSON service specific to each user session. Is this possible?

    Hi,
    what is a JSON service? JSON is an object notation used with REST services. So I assume you have a REST services that returns JSON and you now want to obtain the same identifier for a specific input string? REST services - like all Web Services - are stateless and if you want to associate a request with a specific context then you need to pass a token or similar with the request so the context can be re-established. In your case I would have a look at the code mapped to startConfiguration/{model_id} to verify if the method checks for an existing configuration with the provided ID. Chances are that its the code returning the wrong ID. In general I would go with a token approach.
    Frank

  • How to uniquely identify a users session

    Hi,
    I need to identify a users session, I am aware of the wwctx_api.get_user function but this returns the user name, my problem is that, how do I identify a session, if the user logs on twice then the get_user() function is not unique basically I need to identify the session by some kind of id number and no the users name.
    or can I stop a user logging on twice ?
    thanks in antcipation.
    SD.

    it will cause problems in the database !..
    in another words it is overloading objects.........

  • 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 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");

  • 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

  • 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?

  • Java API Failed to authenticate the user session with LDAP

    I have created a Java class that uses the MDM Java Api's it works fine on our Development environment where the MDM server uses its own built in authentication, but when I moved it to our QA environment where MDM use LDAP for authentication its failed with a  'Failed to authenticate the user session'.  Has anyone seen this before?

    hi Dan,
    The java class which u have created that suppose to works fine on MDM server because to execute that program there are no requirement of such protocols, the problem u will face while exporting those program to an client machine
    LDAP(Lightweight Directory Access protocol) connector communicates with the SAP system using RFC and with the directory server using these standard communication protocol.
    so try to select the protocol such that it should help in making connection between the server,direcotryserver and the client machine through which u can execute u r java class using java Api's.
    i hope this will give u an idea to through ur problem.
    regards,
    swapnil

  • 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

  • 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

  • MTS, Killing the user session?

    My db is using MTS connection, while i kill the user session by using alter system kill session, the ever killed process goes to Pseudo status....even i can't kill from unix level because it uses dispatchers...
    is there any way i kill the user processes in MTS, with out going to pseduo status

    Hi,
    AS ORACLE SAID,
    If an active session cannot be interrupted (it is performing network I/O or rolling
    back a transaction), the session cannot be terminated until the operation completes.
    In this case, the session holds all resources until it is terminated. Additionally, the
    session that issues the ALTER SYSTEM statement to terminate a session waits up to
    60 seconds for the session to be terminated. If the operation that cannot be
    interrupted continues past one minute, the issuer of the ALTER SYSTEM statement
    receives a message indicating that the session has been "marked" to be terminated.
    A session marked to be terminated is indicated in V$SESSION with a status of
    KILLED and a server that is something other than PSEUDO.

  • How to change the max number of the user session?

    Hello,
      The max number of the user session of my system is 6,I want to change it,how should I do?

    Hi Begue,
    This can be done by changing the value of profile paramter rdisp/max_alt_modes. Currently its value in your system must have been set to 6. You can check the value through transaction RZ11. To change it use transaction RZ10.
    For knowing the details of changing values in RZ11 please visit :
    http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a6247505211d189550000e829fbbd/frameset.htm
    After making the changes please restart SAP.
    Please award points if the issue got solved.
    With Regards.
    Ruchit.

  • 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.

  • 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.
    ¯\_(ツ)_/¯

  • The user session for a SAP GUI for HTML could not be created/generated.

    Hi,
    May I know what could be the issue for the above issue?
    We are trying to request for a ITS in a c#.net program with the following codes.
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
    request.Method = "Get";
    request.ContentType = "application/x-www-form-urlencoded";
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();  <<<<<< This line is throwing error >>>>>>  
    Stream responseStream = response.GetResponseStream();
    However, in our legacy system of classic ASP script, we are not encountering any issues and manage to get the response from the ITS. Accessing the url on IE is also working fine.
    set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
    xmlHttp.open "GET", URL , false
    xmlHttp.send()
    str = xmlHttp.responseText
    Any help is much appreciated.
    Thanks.
    Bertina

    From the little information available here I can suggest following:
    1.     Check the Account validity and authorizations of the User used for authentication from DOT NET. If possible, assign SAP_ALL in Development and repeat tests. Later we can narrow down the access easily.
    2.     There is a known Kernel issue with ICF logon message handling, described in SAP Note 1241566 - Set of corrections: Logging on 1/2008. Check if the recommended Kernel patch level is already applied.
    If none of the above helps, please send me the following:
    1.     Trace file for the work process 0 in transaction ST11 on the application server spsisd_ISD_00
    2.     Generate trace files with the highest trace level (3) as per SAP Note: 507994 - Generating plug-in trace files for troubleshooting and send it over.
    We can look at various Kernel and Service level calls from trace files which should help us identify the root cause.

Maybe you are looking for

  • Print report directly from URL

    i have SSRS report where i have prompt to enter to get data. once the data is populated i would like to print directly from the print option rather saving to pdf and print. My page settings format is setup to 9X11 size. with this i can save and print

  • ITunes Match won't get past Step 1

    Hi, I know a lot of people are having trouble with getting past Step 2 at the moment in iTunes Match, but I was just wondering if anyone else was having troubles getting past Step 1? Last night, even just trying to match one song, I was stuck at Step

  • ExpressCard/34 not working in BootCamp Windows 7 64-bit. Apple's BIOS emulation does not give enough resources.

    MacBook Pro unibody, 15" 2009 ExpressCard/34 (Card is by Transcend TS-RDF1, JMicron chip for SD card) is not working in BootCamp Windows 7 64-bit. Windows reports: "This device cannot find enough free resources that it can use. (Code 12) If you want

  • How Install MySQL on Air w/OS 10.6.5 -- For New, Former WinTel User?

    This new MacBook Air (and former WinTel) user welcomes (with appreciation) your *detailed suggestions* regarding installing +MySQL Community Edition 5.5.8+ (I have downloaded mysql-5.5.8-osx10.6-x86_64.tar.gz;, it's sitting in my "Downloads" director

  • Where does this file go??

    import java.net.URL; import java.net.MalformedURLException; import java.io.InputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.FileNotFoundException; public class Test{        public static void main(String[] para