The GetEffectivePermission method in CIM_DataFile is implemented by WMI.
This documentation is derived from the CIM class descriptions published by the DMTF. Microsoft may have made changes to correct minor errors, conform to Microsoft SDK documentation standards, or provide more information.
Example
Do not run below example code just to see what happens next. Many methods seriously affect your system. Always make sure you actually understand what the method and the code do.
param
(
[Parameter(Mandatory)]
[UInt32]
$Permissions
)
$query = 'Select * From CIM_DataFile where Name='c:\\windows\\explorer.exe''
Invoke-CimMethod -Query $query -MethodName GetEffectivePermission -Arguments $PSBoundParameters
To run this method on one or more remote systems, use New-CimSession
:
param
(
[Parameter(Mandatory)]
[UInt32]
$Permissions,
[String[]]
$ComputerName,
[PSCredential]
$Credential
)
$session = New-CimSession -ComputerName $ComputerName -Credential $Credential
$query = 'Select * From CIM_DataFile where Name='c:\\windows\\explorer.exe''
Invoke-CimMethod -Query $query -MethodName GetEffectivePermission -Arguments $PSBoundParameters -CimSession $session
Remove-CimSession -CimSession $session
Learn more about
Invoke-CimMethod
and invoking WMI methods.
Syntax
boolean GetEffectivePermission(
[in] uint32 Permissions
);
Parameters
Name | Type | Description |
---|---|---|
Permissions | UInt32 |
Permissions
List of permissions that the caller can inquire about. You can combine bit flags.
[Flags()]Enum DataFilePermissions
{
READDATA_LISTDIRECTORY = 1 #
WRITEDATA_ADDFILE = 2 #
APPENDDATA_ADDSUBDIR = 4 #
READEA = 8 #
WRITEEA = 16 #
EXECUTE_TRAVERSE = 32 #
DELETECHILD = 64 #
READATTRIBUTES = 128 #
WRITEATTRIBUTES = 256 #
UNKNOWN512 = 512 #
UNKNOWN1024 = 1024 #
UNKNOWN2048 = 2048 #
UNKNOWN4196 = 4096 #
UNKNOWN8192 = 8192 #
UNKNOWN16384 = 16384 #
UNKNOWN32768 = 32768 #
DELETE = 65536 #
READCONTROL = 131072 #
WRITEDAC = 262144 #
WRITEOWNER = 524288 #
SYNCHRONIZE = 1048576 #
UNKNOWN2097152 = 2097152 #
UNKNOWN4194304 = 4194304 #
UNKNOWN8388608 = 8388608 #
}
Return Value
Returns a value of type Boolean. Typically, a value of 0 indicates success.
See Also
Additional methods implemented by CIM_DataFile:
ChangeSecurityPermissions()
ChangeSecurityPermissions() changes the security permissions for the logical file specified in the object path. Implemented by WMI.
ChangeSecurityPermissionsEx()
ChangeSecurityPermissionsEx() changes the security permissions for the logical file specified in the object path. Implemented by WMI.
Compress()
Compress() uses NTFS compression to compress the logical file (or directory) specified in the object path. Implemented by WMI.
CompressEx()
CompressEx() compresses the logical file (or directory) specified in the object path. Implemented by WMI.
Copy()
Copy() copies the logical file (or directory) specified in the object path to the location specified by the input parameter. Implemented by WMI.
CopyEx()
CopyEx() copies the logical file (or directory) specified in the object path to the location specified by the input parameter. Implemented by WMI.
Delete()
Delete() deletes the logical file (or directory) specified in the object path. Implemented by WMI.
DeleteEx()
DeleteEx() deletes the logical file (or directory) specified in the object path. Implemented by WMI.
Rename()
Rename() renames the logical file (or directory) specified in the object path. Implemented by WMI.
TakeOwnerShip()
TakeOwnerShip() obtains ownership of the logical file specified in the object path. Implemented by WMI.
TakeOwnerShipEx()
TakeOwnerShipEx() obtains ownership of the logical file specified in the object path. Implemented by WMI.
Uncompress()
Uncompress() uncompresses the logical file (or directory) specified in the object path. Implemented by WMI.
UncompressEx()
UncompressEx() uncompresses the logical file (or directory) specified in the object path. Implemented by WMI.
Requirements
To use CIM_DataFile, the following requirements apply:
PowerShell
Get-CimInstance
was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.
If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.
Operating System
CIM_DataFile was introduced on clients with Windows Vista and on servers with Windows Server 2008.
Namespace
CIM_DataFile lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance
.
Implementation
CIM_DataFile is implemented in CIMWin32.dll and defined in CIMWin32.mof. Both files are located in the folder C:\Windows\system32\wbem
:
explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\CIMWin32.mof