Closed thomasschuiki closed 6 years ago
Everything looks fine on one of my test machines running the same version of PowerShell:
PS C:\> Install-Module -Name NTFSSecurity -Force
PS C:\> Get-Command -Module NTFSSecurity
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Add-NTFSAccess 4.2.3 NTFSSecurity
Cmdlet Add-NTFSAudit 4.2.3 NTFSSecurity
Cmdlet Clear-NTFSAccess 4.2.3 NTFSSecurity
Cmdlet Clear-NTFSAudit 4.2.3 NTFSSecurity
Cmdlet Copy-Item2 4.2.3 NTFSSecurity
Cmdlet Disable-NTFSAccessInheritance 4.2.3 NTFSSecurity
Cmdlet Disable-NTFSAuditInheritance 4.2.3 NTFSSecurity
Cmdlet Disable-Privileges 4.2.3 NTFSSecurity
Cmdlet Enable-NTFSAccessInheritance 4.2.3 NTFSSecurity
Cmdlet Enable-NTFSAuditInheritance 4.2.3 NTFSSecurity
Cmdlet Enable-Privileges 4.2.3 NTFSSecurity
Cmdlet Get-ChildItem2 4.2.3 NTFSSecurity
Cmdlet Get-DiskSpace 4.2.3 NTFSSecurity
Cmdlet Get-FileHash2 4.2.3 NTFSSecurity
Cmdlet Get-Item2 4.2.3 NTFSSecurity
Cmdlet Get-NTFSAccess 4.2.3 NTFSSecurity
Cmdlet Get-NTFSAudit 4.2.3 NTFSSecurity
Cmdlet Get-NTFSEffectiveAccess 4.2.3 NTFSSecurity
Cmdlet Get-NTFSHardLink 4.2.3 NTFSSecurity
Cmdlet Get-NTFSInheritance 4.2.3 NTFSSecurity
Cmdlet Get-NTFSOrphanedAccess 4.2.3 NTFSSecurity
Cmdlet Get-NTFSOrphanedAudit 4.2.3 NTFSSecurity
Cmdlet Get-NTFSOwner 4.2.3 NTFSSecurity
Cmdlet Get-NTFSSecurityDescriptor 4.2.3 NTFSSecurity
Cmdlet Get-NTFSSimpleAccess 4.2.3 NTFSSecurity
Cmdlet Get-Privileges 4.2.3 NTFSSecurity
Cmdlet Move-Item2 4.2.3 NTFSSecurity
Cmdlet New-NTFSHardLink 4.2.3 NTFSSecurity
Cmdlet New-NTFSSymbolicLink 4.2.3 NTFSSecurity
Cmdlet Remove-Item2 4.2.3 NTFSSecurity
Cmdlet Remove-NTFSAccess 4.2.3 NTFSSecurity
Cmdlet Remove-NTFSAudit 4.2.3 NTFSSecurity
Cmdlet Set-NTFSInheritance 4.2.3 NTFSSecurity
Cmdlet Set-NTFSOwner 4.2.3 NTFSSecurity
Cmdlet Set-NTFSSecurityDescriptor 4.2.3 NTFSSecurity
Cmdlet Test-Path2 4.2.3 NTFSSecurity
Is the execution policy restricted on that machine?
Importing the module with verose output looks like this:
PS C:\> Install-Module -Name NTFSSecurity -Force
PS C:\> Import-Module -Name NTFSSecurity -Verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.psd1'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.types.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module NTFSSecurity.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.Init.ps1'.
VERBOSE: Dot-sourcing the script file 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.Init.ps1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.dll'.
VERBOSE: Importing cmdlet 'Add-NTFSAccess'.
VERBOSE: Importing cmdlet 'Clear-NTFSAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSEffectiveAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSOrphanedAccess'.
VERBOSE: Importing cmdlet 'Remove-NTFSAccess'.
VERBOSE: Importing cmdlet 'Add-NTFSAudit'.
VERBOSE: Importing cmdlet 'Clear-NTFSAudit'.
VERBOSE: Importing cmdlet 'Get-NTFSAudit'.
VERBOSE: Importing cmdlet 'Remove-NTFSAudit'.
VERBOSE: Importing cmdlet 'Set-NTFSInheritance'.
VERBOSE: Importing cmdlet 'Disable-NTFSAccessInheritance'.
VERBOSE: Importing cmdlet 'Disable-NTFSAuditInheritance'.
VERBOSE: Importing cmdlet 'Enable-NTFSAccessInheritance'.
VERBOSE: Importing cmdlet 'Enable-NTFSAuditInheritance'.
VERBOSE: Importing cmdlet 'Get-NTFSInheritance'.
VERBOSE: Importing cmdlet 'Get-ChildItem2'.
VERBOSE: Importing cmdlet 'Get-DiskSpace'.
VERBOSE: Importing cmdlet 'Get-Item2'.
VERBOSE: Importing cmdlet 'Copy-Item2'.
VERBOSE: Importing cmdlet 'Move-Item2'.
VERBOSE: Importing cmdlet 'Remove-Item2'.
VERBOSE: Importing cmdlet 'New-NTFSSymbolicLink'.
VERBOSE: Importing cmdlet 'New-NTFSHardLink'.
VERBOSE: Importing cmdlet 'Get-NTFSHardLink'.
VERBOSE: Importing cmdlet 'Get-FileHash2'.
VERBOSE: Importing cmdlet 'Enable-Privileges'.
VERBOSE: Importing cmdlet 'Disable-Privileges'.
VERBOSE: Importing cmdlet 'Get-Privileges'.
VERBOSE: Importing cmdlet 'Set-NTFSOwner'.
VERBOSE: Importing cmdlet 'Test-Path2'.
VERBOSE: Importing cmdlet 'Get-NTFSSecurityDescriptor'.
VERBOSE: Importing cmdlet 'Set-NTFSSecurityDescriptor'.
VERBOSE: Importing cmdlet 'Get-NTFSSimpleAccess'.
VERBOSE: Importing cmdlet 'Show-SimpleAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSOwner'.
VERBOSE: Importing cmdlet 'Get-NTFSOrphanedAudit'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.psm1'.
VERBOSE: Importing cmdlet 'Add-NTFSAccess'.
VERBOSE: Importing cmdlet 'Add-NTFSAudit'.
VERBOSE: Importing cmdlet 'Clear-NTFSAccess'.
VERBOSE: Importing cmdlet 'Clear-NTFSAudit'.
VERBOSE: Importing cmdlet 'Copy-Item2'.
VERBOSE: Importing cmdlet 'Disable-NTFSAccessInheritance'.
VERBOSE: Importing cmdlet 'Disable-NTFSAuditInheritance'.
VERBOSE: Importing cmdlet 'Disable-Privileges'.
VERBOSE: Importing cmdlet 'Enable-NTFSAccessInheritance'.
VERBOSE: Importing cmdlet 'Enable-NTFSAuditInheritance'.
VERBOSE: Importing cmdlet 'Enable-Privileges'.
VERBOSE: Importing cmdlet 'Get-ChildItem2'.
VERBOSE: Importing cmdlet 'Get-DiskSpace'.
VERBOSE: Importing cmdlet 'Get-FileHash2'.
VERBOSE: Importing cmdlet 'Get-Item2'.
VERBOSE: Importing cmdlet 'Get-NTFSAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSAudit'.
VERBOSE: Importing cmdlet 'Get-NTFSEffectiveAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSHardLink'.
VERBOSE: Importing cmdlet 'Get-NTFSInheritance'.
VERBOSE: Importing cmdlet 'Get-NTFSOrphanedAccess'.
VERBOSE: Importing cmdlet 'Get-NTFSOrphanedAudit'.
VERBOSE: Importing cmdlet 'Get-NTFSOwner'.
VERBOSE: Importing cmdlet 'Get-NTFSSecurityDescriptor'.
VERBOSE: Importing cmdlet 'Get-NTFSSimpleAccess'.
VERBOSE: Importing cmdlet 'Get-Privileges'.
VERBOSE: Importing cmdlet 'Move-Item2'.
VERBOSE: Importing cmdlet 'New-NTFSHardLink'.
VERBOSE: Importing cmdlet 'New-NTFSSymbolicLink'.
VERBOSE: Importing cmdlet 'Remove-Item2'.
VERBOSE: Importing cmdlet 'Remove-NTFSAccess'.
VERBOSE: Importing cmdlet 'Remove-NTFSAudit'.
VERBOSE: Importing cmdlet 'Set-NTFSInheritance'.
VERBOSE: Importing cmdlet 'Set-NTFSOwner'.
VERBOSE: Importing cmdlet 'Set-NTFSSecurityDescriptor'.
VERBOSE: Importing cmdlet 'Test-Path2'.
VERBOSE: Importing alias 'del2'.
VERBOSE: Importing alias 'dir2'.
VERBOSE: Importing alias 'gi2'.
VERBOSE: Importing alias 'rm2'.
When comparing the output it looks like the DLL is not processed correctly. Do you have any restrictions on using DLLs?
What happens if you try to import the DLL directly?
Import-Module 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.dll'
Hi,
thanks for the swift reply. Unfortunately the problem seems to be isolted to my machine.
I tried your commands on my machine and on a second one. The most obvious difference is the Windows Version Update 1803 vs 1709.
1803: not working 1709: working
I was not able to test with another 1803 machine.
The frustrating part is that there are no error messages while loading the module. Even the autocomplete for the commands works.
Some outputs:
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 12:07:05 :
> Install-Module -Name NTFSSecurity -Force
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 12:07:21 :
> Get-Command -Module NTFSSecurity
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 12:07:29 :
> Get-ExecutionPolicy -List
Scope ExecutionPolicy
----- ---------------
MachinePolicy Unrestricted
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 13:16:59 :
> Import-Module -Name NTFSSecurity -Verbose
AUSFÜHRLICH: Modul wird aus Pfad "C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.psd1"
geladen.
AUSFÜHRLICH: Alias "del2" wird importiert.
AUSFÜHRLICH: Alias "dir2" wird importiert.
AUSFÜHRLICH: Alias "gi2" wird importiert.
AUSFÜHRLICH: Alias "rm2" wird importiert.
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 13:17:12 :
> Import-Module 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.dll'
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 13:17:21 :
> Import-Module 'C:\Program Files\WindowsPowerShell\Modules\NTFSSecurity\4.2.3\NTFSSecurity.dll' -verbose
[Admin] (Elevated) adm_teitler@LCD11 C:\WINDOWS\system32 : 26.07.2018 13:17:26 :
Thanks again for helping me!
The big difference is that if you try to import the DLL directly, Import-Module does not list a single cmdlet exported by the DLL.
Can you verify if the DLL is blocked? Does the machine apply any policies from the domain that could explain the behaviour?
Hi,
sorry for the delay. I tried to use the module again today and installed version 4.2.4 and my issues are gone. Unfortunately I'm not able to tell you what changed exactly.
Thanks again for trying to debug my issues!
Hi,
I'm experiencing the following problem. I can successfully install the module via install-module but after that get-module ntfssecurity does not return anything and import-module ntfssecurity shows that only very few cmdlets are beeing loaded.
My powershell version:
My OS version:
How i installed the module:
Ouput of import-module:
After importing get-module reports back:
If I'm trying to use get-ntfsaccess I get the following error:
This basically means that the cmdlet was not recognized.
The following returns nothing:
> Get-Command -Module NTFSSecurity -Noun NTFSAccess
I am aware of the workaround of starting powershell with the -version parameter. Unfortunately that is not an option for me, as my scripts are depending on the newer version of posh.
Sorry for the german outputs I couldn't figure out how to completely change my powershell language yet.
Please let me know if you need any clarification or how I can help with any testing. Thanks for looking into this!
Best Regards, Thomas