Export the local policy : Allow Log On Locally


  • Before implementing a mandatory GPO I need to verify if that does not conflict with the local policies on one of my servers.

    I would like to know if there is a (powershell) script that can show me, from a list of servers (.csv), what the setting is of the User Right Assignment policy -> Allow Logon Locally.

    Any help appreciated

    Monday, May 11, 2015 1:48 PM


All replies

  • Hi,

    Thanks for posting. You can follow the steps below to list the current setting of the server allow logon locally policy:

    1. Download the Userright powershell module to the server from the below link:

    2. Use command to import the powershell model as this :

    3. Use command to list the setting of logon locally:

    Import-Module c:\userrights
    Get-UserRight -privileges SeInteractiveLogonRight

    Hope it helps.

    Best Regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact

    Tuesday, May 12, 2015 8:21 AM
  • Hello Elaine,

    Thank you for your reply, I did an import-module but it returns with an error that I cannot get rid of, saying:

    Import-Module : The 'C:\Scripts\VerifySeInteractiveLogonRight\UserRights\UserRights\UserRights.psd1' module cannot be imported because its manifest contains one or more members that are not valid.
    The valid manifest members are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture','RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport').
    Remove the members that are not valid ('RootModule'), then try to import the module again.
    At line:1 char:14
    + Import-Module <<<<  C:\Scripts\VerifySeInteractiveLogonRight\UserRights\UserRights
        + CategoryInfo          : InvalidData: (C:\Scripts\Veri...UserRights.psd1:String) [Import-Module], InvalidOperationException
        + FullyQualifiedErrorId : Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommand

    My Powershell as well as .NET versions meet the minimum requirements that are stated in the PSD1 file.

    Wednesday, May 13, 2015 7:23 AM
  • > My Powershell as well as .NET versions meet the minimum requirements
    > that are stated in the PSD1 file.
    These are wrong, unfortunately... RootModule was introduced in PoSh 3.0.
    In PoSh 2.0, ModuleToProcess has to be used.

    Greetings/Grüße, Martin

    Mal ein gutes Buch über GPOs lesen?
    Good or bad GPOs? - my blog…
    And if IT bothers me - coke bottle design refreshment (-:
    Wednesday, May 13, 2015 8:31 AM