Get-ADUser lastLogonTimestamp is reporting blank

Hey guys,
I'm simply looking to get a list of users and their last login, in it's simplest form I'm trying this:
Get-ADUser -filter * -searchbase 'CN=Users,DC=domain,DC=com,DC=au' -Properties name,lastLogonTimestamp | select name,lastLogonTimestamp | out-gridview
Which works in a way, the problem is that most of the 'lastLoginTimestamp' properties are empty. If I go through AD Explorer (from SysInternals) there is definitely a value in that property.  Even if I test with my own user name that logs in every day
it returns blank.
If they were all blank I would look at a problem in the script, but some of them DO return the correct value.
Is there something I'm missing?

Hi,
Please take a look at following links about lastlogon and lastlogontimestamp attributes.
http://blogs.technet.com/b/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx
http://social.technet.microsoft.com/Forums/windowsserver/en-US/1ae08081-dcfe-44cd-bc3b-f5ac26d53f76/difference-between-lastlogon-and-lastlogontimestamp
Please also try with following examples:
To collect user's lastlogon attribute across ALL DCs in domain: (Some user may have different last logon value on different DCs)
foreach ($dc in (Get-ADDomainController -Filter "domain -eq '$((Get-ADDomain).DnsRoot)'" | % { $_.HostName} ) ) { Get-ADUser -Filter '*' -searchbase 'CN=Users,DC=domain,DC=com,DC=au' -Server $dc -Properties LastLogon | Select SamAccountName, LastLogon, @{n='LastLogonDC'; e={ $dc }} }
To collect users' latest lastlogon attribute:
$( foreach ($dc in (Get-ADDomainController -Filter "domain -eq '$((Get-ADDomain).DnsRoot)'" | % { $_.HostName} ) ) { Get-ADUser -Filter '*' -searchbase 'CN=Users,DC=domain,DC=com,DC=au' -Server $dc -Properties LastLogon | Select SamAccountName, LastLogon, @{n='LastLogonDC'; e={ $dc }} } ) | Group SamAccountName | % { ($_.Group | sort lastLogon -Descending)[0] } | select SamAccountName, lastlogon,@{n='LastLogon1'; e={ (Get-Date $_.LastLogon).ToLocalTime() }}, LastLogonDC
You can pipe the above code with Export-CSV or grid view.
Without using AD module:
$adSearcher = [adsisearcher]""
$adSearcher.Filter = '(&(objectClass=user)(objectCategory=person))'
$adSearcher.PageSize = 1000
$adSearcher.PropertiesToLoad.Add('LastLogon')
$adSearcher.PropertiesToLoad.Add('SamAccountName')
$( foreach ( $dc in ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).DomainControllers ) { $adSearcher.SearchRoot = 'LDAP://'+$dc.name; $adSearcher.FindAll() | select @{n='SamAccountName'; e={ $_.properties.samaccountname}}, @{n='LastLogonDC'; e= { $dc.name}}, @{n='LastLogon'; e={ $_.properties.lastlogon}} } ) | Group SamAccountName | % { ($_.Group | sort lastLogon -Descending)[0] } | select SamAccountName, LastLogon, @{n='LastLogon1'; e={ (Get-Date $_.LastLogon).ToLocalTime() }}, LastLogonDC
rgds,
AZ

Similar Messages

  • Using get-aduser -filter to find blank spaces only

    Hello all,
    What I'm trying to do is pretty simple. I want to use the -filter parameter of the get-aduser cmdlet to find a defined attribute that only contains a space. For example, I want to find any users that have extensionattribute1 equal to " ". I've
    tried the following code but I get the error "the search filter cannot be recognized":
    get-aduser -filter {extensionattribute1 -eq " "}
    What I don't want to use is -like "* *", as that will give me values that contain a space anywhere. I only want to return users that have extensionattribute1 equal to one space.
    Any ideas?

    Yes, in LDAP syntax you can escape any character with the backslash escape character followed by the two character hex ASCII representation of what you want. You can get foreign characters this way. More on escaping characters here:
    http://social.technet.microsoft.com/wiki/contents/articles/5312.active-directory-characters-to-escape.aspx
    Richard Mueller - MVP Directory Services

  • Error troubleshooting in AD Module - Get-Aduser w/created filter

    Hi All,
    I'm working as an intern with my university, and I've been tasked with clearing out old student accounts in AD. There are currently over 4000 users in our system, and it's estimated that there are over 3500 old accounts that need to be deleted.
    We are at the 2008 R2 Domain Functional Level.
    I am going to script this through Powershell, but I'm having a terrible time getting a certain query to run properly.
    I am using the following:
    get-aduser -filter {created -lt '1/1/2010' -and lastlogontimestamp -notlike '*'} -properties created
    I will sometimes narrow my query by adding another filter for created -gt '1/1/2008', for instance.
    When I run the command as written, however, it will return several hundred users, but then it spits out the following error after the last displayed result:
    Get-ADUser : The specified method is not supported
    At C:\Users\Administrator.CSC\Desktop\test1.ps1:4 char:15
    + get-aduser <<<< -filter {created -lt '1/1/2010'} -properties created | ft name,samaccountname,created
    + CategoryInfo : NotSpecified: (:) [Get-ADUser], ADException
    + FullyQualifiedErrorId : The specified method is not supported,Microsoft.ActiveDirectory.Management.Commands.GetADUser
    If I narrow my search scope by created date, I can sometimes get the error to not appear. My guess is that there are several accounts in the database that trigger the error (or at least, that's how it appears).
    I have tried running this on both a DC and a non-dc server with server management tools installed. It doesn't matter what other filters are used, so omitting the lastlogontimestamp filter doesn't prevent the error.
    My supervisor seems to think there may be errors in the AD database, but I've done every AD health check I can think of.
    Does anyone have any suggestions?
    Thanks,
    Brandon

    If you have access to Microsoft Connect (I believe you must be an MVP), it would help to vote on this report, as that should help prioritize it.
    You don't need to be a MVP for access to Connect, here's a direct link to the bug report Richard opened:
    https://connect.microsoft.com/PowerShell/feedbackdetail/view/963333/ad-module-cmdlets-raise-error-if-there-are-more-than-256-results
    The command from the report does appear to work for me in v4 (Win7):
    PS C:\> Get-ADUser -Properties Created -Filter "Created -gt '9/1/2014'" | measure
    Count : 260
    I also tested the command that failed in the post above and v3 appears to be working for me as well (WS2012):
    PS C:\> $start = (Get-Date).AddDays(-1)
    PS C:\> get-aduser -filter {modified -gt $start} | measure
    Count : 263
    Perhaps the count needs to be higher to replicate this.
    EDIT: I just created a bunch of new user accounts and I still can't replicate this (v3 on WS2012 again):
    PS C:\> $start = (Get-Date).AddDays(-1)
    PS C:\> get-aduser -filter {modified -gt $start} | measure
    Count : 1803
    EDIT2: DC is WS2008SP2.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Get-ADuser and formatting results

    What Im looking to do is to output all of my AD Users, including all of their properties, and then output that to a tabular format. The issue I am having is that some of the fields, like MemberOf, dont come through. My script looks like the following:
    Get-ADuser -Filter * -Properties * | Export-CSV C:\Temp\MyFile.csv
    This is almost what I want, but I just need for all of the properties to be expanded. Some end in "..." meaning there is more to be shown, and others such as "MemberOf" show "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection" instead of showing
    the actual groups.
    Thanks in advance for any help!
    Jarrod Sturdivant [email protected]

    I had the same question and the "Exchange Proxy Address (alias) Report" Blog entry helped me a lot in this case.
    Here is my adaption
    $multipcgroups = @()
     $Pclist = import-csv mypclist.csv | foreach {get-adcomputer -identity $_.name -Properties * | select name, memberof}
     foreach ($pc in $pclist) {
     [array]$pcgroups = $pc.memberof
    $ErrorActionPreference = 'SilentlyContinue'
     $pcadgroup = New-Object PSObject -Property @{
    Name = $pc.name
     pcadgroup0 = $pcgroups[0] -replace "OU=SW,OU=Groupx,OU=foo,DC=company,DC=de" -replace "OU=Filter,OU=Technical Roles,DC=company,DC=de"
    pcadgroup1 = $pcgroups[1] -replace "OU=SW,OU=Groupx,OU=foo,DC=company,DC=de" -replace "OU=Filter,OU=Technical Roles,DC=company,DC=de"
    pcadgroup2 = $pcgroups[2] -replace "OU=SW,OU=Groupx,OU=foo,DC=company,DC=de" -replace "OU=Filter,OU=Technical Roles,DC=company,DC=de"
    $ErrorActionPreference = 'Continue'
     $pcadgroupCount = ($pcgroups).count
     if ($pcadgroupCount -gt 0) {
    $multipcgroups += $pcadgroup
     $multipcgroups | select name, pcadgroup0,pcadgroup1,pcadgroup2 | Export-CSV pcadgroups.csv -notype
    regards
    Andreas

  • Powershell Get-ADUser returns Computer objects as well ???! How to prevent.

    I ran the following script and got a bunch of computer objects in my csv. How to i Prevent this? I already tried using 
    Where-Object{$_.type
    -eq
    "user"} OR
     -filter{type
    -eq
    "user"}
    script:
    Get-ADUser-Filter*-PropertiessamAccountName,accountExpires,Created,LastLogonTimeStamp,Department,physicalDeliveryOfficeName,employeeID,AccountExpirationDate,Manager|
    Where-Object
    {$_.accountexpirationdate
    -lt$timex}
    |
    select
    Name,samAccountName,@{Name="Timestamp";
    Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}},@{n='Date
    Created';e={$_.created}},Department,@{n='Location';e={$_.physicalDeliveryOfficeName}},employeeID,AccountExpirationDate,@{Label='Manager
    sAMAccountName';Expression={(Get-ADUser$_.Manager).sAMAccountName}},@{Label='Manager
    Name';Expression={(Get-ADUser$_.Manager).name}}
    |
    export-csv
    -path$mypath-notypeinformation

    Someone told me the Computer accounts are generic accounts...makes any sense?
    No.
    EDIT: What's the output of this command for one of these computer accounts:
    Get-ADUser ThatComputerAccount | Select *
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • Some user Accounts have no "status" string when using Get-ADUser command.

    Hello!
    I encountered a problem. When I tryed to get list of all disabled accounts in the AD, I used the command Get-ADUser -Filter 'Enabled -eq $false' . 
    But i recieved a list of users which is not full.
    So I checked again and compared 2 accounts,  both a disabled but one had a "Status" string, and the second had not.
    In gui Snap-in all Disabled accounts marked as disabled.
    So I can' t get a list of disabled users right now. 
    So here is an Example:
    DistinguishedName : CN=User1,OU=OU2,OU=OU1,DC=Domain, DC=ru
    Enabled           : False 
    GivenName         : 
    Name              : Name  
    ObjectClass       : user 
    ObjectGUID        : 3daeb58d-47f1-47a9-ad5b-bec5fd804ac0 
    SamAccountName    : user1 
    SID               : S-1-5-21-516317273-842993208-2210532530-2418 
    Surname           : Surname
    UserPrincipalName : [email protected]
    PS C:\Users\smb_khvatov> Get-ADUser komarova 
    DistinguishedName : CN=User2,OU=OU2,OU=OU1,DC=Domain, DC=ru
    GivenName         : Name
    Name              : Name
    ObjectClass       : user 
    ObjectGUID        : df8cdf8d-b0ff-4d0b-941e-3cd65d722394 
    SamAccountName    : User2
    SID               : S-1-5-21-516317273-842993208-2210532530-16161 
    Surname           : Surname
    UserPrincipalName :[email protected]

    Hope I understood you correctly:
    2 Blocked Accounts
    First one is a normal (has a "enable" string)
    Second one is without "enable" string.
    PS C:\Users\Administrator> get-aduser bychkov -properties *
    AccountExpirationDate :
    accountExpires : 9223372036854775807
    AccountLockoutTime :
    AccountNotDelegated : False
    adminCount : 1
    AllowReversiblePasswordEncryption : False
    BadLogonCount :
    CannotChangePassword : False
    CanonicalName : DOMAIN.RU/Desktop/IT/Nikolay Bychkov
    Certificates : {}
    City :
    CN : Nikolay Bychkov
    codePage : 0
    Company :
    CompoundIdentitySupported : {False}
    Country :
    countryCode : 0
    Created : 5/12/2010 4:20:23 AM
    createTimeStamp : 5/12/2010 4:20:23 AM
    Deleted :
    Department :
    Description :
    DisplayName : Nikolay Bychkov
    DistinguishedName : CN=Nikolay Bychkov,OU=IT,OU=Desktop,DC=DOMAIN,DC=RU
    Division :
    DoesNotRequirePreAuth : False
    dSCorePropagationData : {12/31/1600 4:00:00 PM}
    EmailAddress : [email protected]
    EmployeeID :
    EmployeeNumber :
    Enabled : False
    Fax :
    GivenName :
    HomeDirectory :
    HomedirRequired : False
    HomeDrive :
    homeMDB : CN=Russia HO,CN=Offices
    SG,CN=InformationStore,CN=RUS-ML-02,CN=Servers,CN=Exchange Administrative Group
    (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU
    homeMTA : CN=Microsoft MTA,CN=RUS-ML-02,CN=Servers,CN=Exchange Administrative Group
    (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU
    HomePage :
    HomePhone :
    Initials :
    instanceType : 4
    isDeleted :
    KerberosEncryptionType : {None}
    LastBadPasswordAttempt :
    LastKnownParent :
    LastLogonDate : 6/7/2012 4:47:35 AM
    lastLogonTimestamp : 129835432554560428
    legacyExchangeDN : /o=Company/ou=Exchange Administrative Group
    (FYDIBOHF23SPDLT)/cn=Recipients/cn=Bychkov
    LockedOut : False
    LogonWorkstations :
    mail : [email protected]
    mailNickname : Bychkov
    Manager : CN=Administrator,OU=IT,OU=Russia,OU=Users,OU=My Users and
    Groups,DC=DOMAIN,DC=RU
    mDBUseDefaults : True
    MemberOf : {CN=Taxi,CN=Users,DC=DOMAIN,DC=RU,
    CN=TS_Users,OU=Security,OU=Groups,DC=DOMAIN,DC=RU,
    CN=WS-FUTURA_ADM,OU=Security,OU=Groups,DC=DOMAIN,DC=RU}
    MNSLogonAccount : False
    MobilePhone :
    Modified : 1/28/2014 6:30:40 AM
    modifyTimeStamp : 1/28/2014 6:30:40 AM
    msDS-SupportedEncryptionTypes : 0
    msDS-User-Account-Control-Computed : 8388608
    msExchHideFromAddressLists : True
    msExchHomeServerName : /o=Company/ou=Exchange Administrative Group
    (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=RUS-ML-02
    msExchMailboxGuid : {190, 164, 153, 18...}
    msExchMailboxSecurityDescriptor : System.DirectoryServices.ActiveDirectorySecurity
    msExchMailboxTemplateLink : CN=730,CN=ELC Mailbox Policies,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU
    msExchMDBRulesQuota : 256
    msExchPoliciesIncluded : {{1D2FFDEC-44A9-4E96-A1FD-0744A455AE4D},{26491CFC-9E50-4857-861B-0CB8DF22B5D7}}
    msExchRecipientDisplayType : 1073741824
    msExchRecipientTypeDetails : 1
    msExchUserAccountControl : 0
    msExchUserCulture : ru-RU
    msExchVersion : 4535486012416
    Name : Nikolay Bychkov
    nTSecurityDescriptor : System.DirectoryServices.ActiveDirectorySecurity
    ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=DOMAIN,DC=RU
    ObjectClass : user
    ObjectGUID : 3daeb58d-47f1-47a9-ad5b-bec5fd804ac0
    objectSid : S-1-5-21-516317273-842993208-2210532530-2418
    Office :
    OfficePhone :
    Organization :
    OtherName :
    PasswordExpired : True
    PasswordLastSet : 10/24/2011 5:06:59 AM
    PasswordNeverExpires : False
    PasswordNotRequired : False
    POBox :
    PostalCode :
    PrimaryGroup : CN=Domain Users,CN=Users,DC=DOMAIN,DC=RU
    primaryGroupID : 513
    PrincipalsAllowedToDelegateToAccount : {}
    ProfilePath :
    ProtectedFromAccidentalDeletion : False
    protocolSettings : {HTTP§1§1§§§§§§, OWA§1}
    proxyAddresses : {X400:C=RU;A= ;P=Company;O=Exchange;S=Bychkov;, SMTP:[email protected]
    pwdLastSet : 129639316194314373
    SamAccountName : Bychkov
    sAMAccountType : 805306368
    ScriptPath :
    sDRightsEffective : 0
    ServicePrincipalNames : {}
    SID : S-1-5-21-516317273-842993208-2210532530-2418
    SIDHistory : {}
    SmartcardLogonRequired : False
    State :
    StreetAddress :
    Surname :
    textEncodedORAddress : C=RU;A= ;P=Company;O=Exchange;S=Bychkov;
    Title :
    TrustedForDelegation : False
    TrustedToAuthForDelegation : False
    UseDESKeyOnly : False
    userAccountControl : 514
    userCertificate : {}
    UserPrincipalName : [email protected]
    uSNChanged : 18508
    uSNCreated : 17066
    whenChanged : 1/28/2014 6:30:40 AM
    whenCreated : 5/12/2010 4:20:23 AM
    PS C:\Users\Administrator> get-aduser komarova -properties *
    AccountExpirationDate :
    accountExpires :
    AccountLockoutTime :
    BadLogonCount :
    CannotChangePassword : False
    CanonicalName :
    Certificates : {}
    City :
    CN : Veronika Komarova
    codePage : 0
    Company :
    CompoundIdentitySupported : {}
    Country :
    countryCode : 0
    Created :
    Deleted :
    Department :
    Description :
    DisplayName : Veronika Komarova
    DistinguishedName : CN=Veronika Komarova,OU=Product Department,OU=Office,OU=Russia,OU=Users,OU=My
    Users and Groups,DC=DOMAIN,DC=RU
    Division :
    EmailAddress : [email protected]
    EmployeeID :
    EmployeeNumber :
    Fax :
    GivenName : Veronika
    HomeDirectory :
    HomeDrive :
    homeMDB : CN=Russia HO,CN=Offices
    SG,CN=InformationStore,CN=RUS-ML-02,CN=Servers,CN=Exchange Administrative Group
    (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU
    homeMTA : CN=Microsoft MTA,CN=RUS-ML-02,CN=Servers,CN=Exchange Administrative Group
    (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU
    HomePage :
    HomePhone :
    Initials :
    instanceType :
    internetEncoding : 0
    isDeleted :
    KerberosEncryptionType : {}
    LastBadPasswordAttempt :
    LastKnownParent :
    LastLogonDate :
    legacyExchangeDN : /o=Company/ou=Exchange Administrative Group
    (FYDIBOHF23SPDLT)/cn=Recipients/cn=komarova
    LogonWorkstations :
    mail : [email protected]
    mailNickname : komarova
    Manager :
    mDBUseDefaults : True
    MemberOf : {}
    MobilePhone :
    Modified :
    msExchHomeServerName : /o=Company/ou=Exchange Administrative Group
    (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=RUS-ML-02
    msExchMailboxGuid : {166, 229, 120, 212...}
    msExchMailboxSecurityDescriptor : System.DirectoryServices.ActiveDirectorySecurity
    msExchMDBRulesQuota : 64
    msExchPoliciesIncluded : {{1D2FFDEC-44A9-4E96-A1FD-0744A455AE4D},{26491CFC-9E50-4857-861B-0CB8DF22B5D7}}
    msExchRecipientDisplayType : 1073741824
    msExchRecipientTypeDetails : 1
    msExchUserAccountControl : 0
    msExchUserCulture : ru-RU
    msExchVersion : 4535486012416
    Name : Veronika Komarova
    nTSecurityDescriptor : System.DirectoryServices.ActiveDirectorySecurity
    ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=DOMAIN,DC=RU
    ObjectClass : user
    ObjectGUID : df8cdf8d-b0ff-4d0b-941e-3cd65d722394
    objectSid : S-1-5-21-516317273-842993208-2210532530-16161
    Office :
    OfficePhone :
    Organization :
    OtherName :
    PasswordLastSet :
    POBox :
    PostalCode :
    PrimaryGroup : CN=Domain Users,CN=Users,DC=DOMAIN,DC=RU
    primaryGroupID : 513
    PrincipalsAllowedToDelegateToAccount : {}
    ProfilePath :
    ProtectedFromAccidentalDeletion : False
    proxyAddresses : {smtp:[email protected], SMTP:[email protected]}
    SamAccountName : komarova
    sAMAccountType : 805306368
    ScriptPath :
    sDRightsEffective : 0
    ServicePrincipalNames : {}
    showInAddressBook : {CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists
    Container,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU, CN=All Users,CN=All
    Address Lists,CN=Address Lists Container,CN=Company,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=RU}
    SID : S-1-5-21-516317273-842993208-2210532530-16161
    SIDHistory : {}
    sn : Komarova
    State :
    StreetAddress :
    Surname : Komarova
    Title :
    userCertificate : {}
    UserPrincipalName : [email protected]

  • Get-ADUser -Filter {extensionAttribute1 -ne "aaa"} to get the users

    I need get these users who's extensionAttribute1 is null or blank.
    I can run this commamd well :
    Get-ADUser -Filter {extensionAttribute1 -eq "aaa"} -SearchBase "OU=Sales,OU=aaa,DC=ccc,DC=ddd,DC=org"
    but when i change the "-eq" with "-ne", this command return nothing.
    Get-ADUser -Filter {extensionAttribute1 -ne "aaa"} -SearchBase "OU=Sales,OU=aaa,DC=ccc,DC=ddd,DC=org"
    Anyone can please help me to check the problem?
    thanks and regards,
    adsnow
    adsnow

    Hi,
    You can use the PowerShell command given below, to get the names of AD Users whose extensionAttribute1 is null or blank,
    Get-ADUser -Filter {extensionAttribute1 -notlike "*"} -SearchBase "OU=Sales,OU=aaa,DC=ccc,DC=ddd,DC=org" | select name
    FYI:
    To get the names of AD Users with any value set for extensionAttribute1 as,
    Get-ADUser -Filter {extensionAttribute1 -like "*"} -SearchBase "OU=Sales,OU=aaa,DC=ccc,DC=ddd,DC=org" | select name
    Regards,
    Gopi
    JiJi
    Technologies

  • Values are not getting updated in sales report

    I have configured sales information system, and i have been trying to run sales report but values are not getting updated in sales report, System will through message that no data exists.
    regards,
    thooyavan

    Hi,
    Please check with the Customer and Material Statistics group in the Customer and material master respectively.
    Further check with the LIS settings (Sales Area combination with the Update group).
    Reward points if this helps you.
    Regards,
    Harsh

  • Tables req to get date wise stock report

    Hi
    Pls advise, what are the tables req to get date wise stock report??? i don't want any t codes... i have to do with age analysis ,??
    Anyone has answer? pls provide it.
    Edited by: UJ on Mar 3, 2010 8:54 AM

    You can take below details which help you to get the exact things..
    *-- Tables delcaraion
    TABLES : mkpf,   " Header: Material Document
                  mseg,   " Document Segment: Material
                 mara,   " General Material Data
                 makt.   " Material Descriptions
    *-- Types declaration
    TYPES: BEGIN OF ty_mkpf,
            mblnr TYPE mblnr, " Number of Material Document
            mjahr TYPE mjahr, " Material Document Year
            blart TYPE blart, " Document type
            budat TYPE budat, " posting date
           END OF ty_mkpf.
    TYPES: BEGIN OF ty_mseg,
            mblnr TYPE mseg-mblnr, " Number of Material Document
            mjahr TYPE mseg-mjahr, " Material Document Year
            zeile TYPE mseg-zeile, " Item in Material Document
            matnr TYPE mseg-matnr, " Material Number
            bwart TYPE mseg-bwart, " Movement Type (Inventory Management)
            dmbtr TYPE mseg-dmbtr, " Amount in Local Currency
            menge TYPE mseg-menge, " Quantity
            lgort TYPE mseg-lgort, " Storage Location
            pbamg TYPE mseg-pbamg, " Quantity
            werks TYPE mseg-werks, " Plant
            ummat TYPE mseg-ummat, " Receiving/Issuing Material
            umwrk TYPE mseg-umwrk, " Receiving/Issuing Plant
            umlgo TYPE mseg-umlgo, " Receiving/Issuing Storage Location
           END OF ty_mseg.
    Further if you want you can play with Movement types.

  • Firefox will not open at all. I only get the Mozilla Crash Reporter over and over.

    After updating yesterday, Firefox will not open. I repeatedly get the Mozilla Crash Reporter. I've scanned my computer for malware, I've tried to open it in safe mode (it won't), I've completely uninstalled and reinstalled Mozilla, but nothing works. Each time I reinstall, I still get the Mozilla Crash Reporter. The program will not open at all.
    I ran my crash ID. Here is the info: bp-eff196eb-ed21-45ee-83c6-e0fc42130123

    hello, this crash is caused by Websense Endpoint security software that is running on the system. please try to install all the updates for this program that are available...

  • How do I use Get-ADUser to get just the Managers attribute? And then get rid of duplicates in my array/hash table?

    Hello,
          I am trying to just get the Managers of my users in Active Directory. I have gotten it down to the user and their manager, but I don't need the user. Here is my code so far:
    Get-ADUser-filter*-searchbase"OU=REDACTED,
    OU=Enterprise Users, DC=REDACTED, DC=REDACTED"-PropertiesManager|SelectName,@{N='Manager';E={(Get-ADUser$_.Manager).Name}}
    |export-csvc:\managers.csv-append 
    Also, I need to get rid of the duplicate values in my hash table. I tried playing around with -sort unique, but couldn't find a place it would work. Any help would be awesome.
    Thanks,
    Matt

    I would caution that, although it is not likely, managers can also be contact, group, or computer objects. If this is possible in your situation, use Get-ADObject in place of Get-ADUser inside the curly braces.
    Also, if you only want users that have a manager assigned, you can use -LDAPFilter "(manager=*)" in the first Get-ADUser.
    Finally, if you want all users that have been assigned the manager for at least one user, you can use:
    Get-ADUser
    -LDAPFilter "(directReports=*)" |
    Select @{N='Manager';E={ (Get-ADUser
    $_.sAMAccountName).Name }}
    -Unique | Sort Manager |
    Export-Csv .\managerList.csv -NoTypeInformation
    This works because when you assign the manager attribute of a user, this assigns the user to the directReports attribute of the manager. The directReports atttribute is multi-valued (an array in essence).
    Again, if managers can be groups or some other class of object (not likely), then use Get-ADObect throughout and identify by distinguishedName instead of sAMAccountName (since contacts don't have sAMAccountName).
    Richard Mueller - MVP Directory Services

  • Is there a way to speed up Get-QADUser or Get-ADUser?

    Hello,  I was wondering if there was a way to speed the commands up to query faster?  My one-liner looks like:
    Get-ADUser -SearchBase "OU=People,DC=Domain,DC=Company,DC=Net" -Filter {Title -eq "Job Title"} -ResultSetSize $null -Properties * | Select SamAccountName, DisplayName, Manager
    Are we able to somehow omit property fields that it looks up?  Would that help?
    I've tried looking through Google and couple of forums, but could not find the answer.
    I have used a tool called "ADFind" and was able to get the results in less than 5 minutes, but Powershell seems to take WAYY longer to do this.
    Thank you!

    Hi,
    Yes, drop the wildcard from Properties and only request the properties that you're interested in.
    Out of curiosity, how many users are returned by this query?
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • How can i get dyanamic image in report template

    How can i get image dynamically in report template

    the report forum is the best place for such questions
    Reports

  • How can I get Status of the report using after report trigger

    I want to get Status of my report on GUI . I am aware that we can look into XMLP_SCHED_OUTPUT table to get all the required details but I am not aware as how I can pull data from this table and make it available on GUI screen. Or is there any way to use jobid of the report and use in Data template of the same report?
    Any help on this will be greatly appreciated.

    What/which GUI? One of your own making? Design it and query from the table(s) of interest, and populate fields based on the results. Which job ID? The latest or one of your choosing? Add a drop down list or menu and let the user select which job. Fairly vague requirements you've listed.

  • The Command Get-ADUser -Identity username -Properties * No Longer Works Due to a Bug in PowerShell 4 and Win8-1 Pro

    The 'Command Get-ADUser -Identity <username> -Properties *' No Longer Works Due to a Bug in PowerShell 4 and Win8-1 Pro
    It produces the following error:
    Get-ADUser : One or more properties are invalid.
    Parameter name: msDS-AssignedAuthNPolicy
    At line:1 char:1
    + Get-ADUser -Identity ********** -Properties *
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (**********:ADUser) [Get-ADUser], ArgumentException
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.GetADUser
    This is already documented in these forums:
    1. http://social.technet.microsoft.com/Forums/systemcenter/en-US/1bf9568e-6adc-495d-a37c-48877f86985a/powershell-40-and-the-activedirectory-ps-module?forum=w81previtpro
    2. https://connect.microsoft.com/PowerShell/feedback/details/806452/windows-8-1-powershell-4-0-get-adcomputer-properties-bug
    Unfortunately, in typical style, Microsoft have archived number 1 without bothering to respond with advice.  Can someone in Microsoft please advise your customers here if this is being investigated and of any available workaround or fix ?
    -- huddie "If you're not seeking help or offering it, you probably shouldn't be here."

    Did you consider using one of the "workarounds" below to run an existing version of the AD Module for PowerShell under a specific PowerShell version:
    a. #require -version 3.0    (in ps1 script)
    b. powershell -version 3.0
    Thank you for sharing with us if this helps.
    Desmond, did you miss my reply below ?  I still haven't heard back from you:
    >> "Desmond,
    >> 
    >> Thanks for your quick response.
    >> 
    >> I'm running this just as a command, not in a script:
    >> 
    >> Get-ADUser -Identity <username> -Properties *
    >> 
    >> When I try to run powershell
    -version 3.0 first, then run the above command, it still fails with the same error.  When I then run Get-Host,
    the version still shows as 4.0 so maybe there's more I need to do to launch a 3.0 host.  Anyway, from what I've read it seems your command is more aimed at script compatibility.
    >> 
    >> Can you help ?"
    -- huddie "If you're not seeking help or offering it, you probably shouldn't be here."

Maybe you are looking for

  • How to print a list of the folders and files in a higher level folder?

    I want to print out a list of the files that I have in a folder. It contains a nested series of folders with files in each. I want to print a list of folders and files in the same order that I see them on the screen. I'm seeing them in the finder in

  • How do you turn off the 2-sided printing feature on hp 8500 printer?

    I want to print one sided only.  When I have four originals I want four one sided copies.  I keep getting two , two sided

  • Unable to connect to Wi-Fi with password

    Hello, I'm having a slight issue with an iPod and iPad. As the title says, I'm unable to connect to wi-fi with password encryption (WPA2). I don't understand why! I can connect to wi-fi when I take the password encryption off. I've been able to conne

  • Can't reset password for my other account

    The page that comes up for resetting passwords automatically says that the new password doesn't match itself.   Can't get around this.   Trying to reset christinebrady79.   Who can help me with this?  How can I talk directly to SKYPE.    Had to creat

  • How do I update my itunes to 11.1 on my pc?

    I downloaded iTunes on my pc a few weeks ago, now, i want to reconnect my iphone to it so i can put some videos in it, but it cant connect because iTunes needs to be updated. Is there a way to update it without uninstalling it and then reinstalling i