Category Archives: File system

Blocksize missing?

I recently had a question asking why the Bloacksize property on Win32_LogicalDisk is empty but is populated on Win32_Volume. The thing is to remember the underlying thing that these 2 CIM classes represent. A logical disk is a subdivision of … Continue reading

Posted in CIM, File system | Leave a comment

Copy a file with WMI

A question came up on the forum about copying files with CIM (WMI). I normally use Copy-Item rather than CIM as its easier. The questioner was using CIM_LogicalFile when I’ve normally used CIM_DataFile so I decided to take a look … Continue reading

Posted in CIM, File system, PowerShell and WMI | Leave a comment

Awkward file and folder names

Spent some time today dealing with a situation where there were special characters – namely [ ] in folder a file names £> Get-ChildItem -Path C:\Test     Directory: C:\Test Mode                LastWriteTime     Length Name—-                ————-     —— —-d—-        21/01/2015     17:58            Awkward [One]d—-        … Continue reading

Posted in File system, Powershell Basics | Leave a comment

Finding a file version

Interesting question on the forum – how to find the file version of IE on remote machines? Get-CimInstance -ClassName CIM_DataFile -Filter “Name = ‘C:\\Program Files\\Internet Explorer\\iexplore.exe’”  | select -ExpandProperty Version Use the CIM_dataFile class.  Its one of the few CIM_ … Continue reading

Posted in File system, PowerShell and WMI | Leave a comment

File system ACLS – inheritance

  When you look at a FileSystemAccessRule it’llbe something like this: FileSystemRights  : Modify, SynchronizeAccessControlType : AllowIdentityReference : NT AUTHORITY\Authenticated UsersIsInherited       : TrueInheritanceFlags  : NonePropagationFlags  : None So far we haven’t dealt with the three inheritance flags. Isinherited indicates that … Continue reading

Posted in File system, Powershell | Leave a comment

File system ACLs–function to add ACL

I thought that today I’d start putting together a function to add an ACL to a file system object. The starting point is the code that stepped through the process in an earlier post: http://msmvps.com/blogs/richardsiddaway/archive/2014/05/26/file-system-acls-creating-an-acl.aspx function add-acl {[CmdletBinding()]param ( [Parameter(Mandatory=$true)] … Continue reading

Posted in File system, Powershell | Leave a comment

File system ACLs – copying ACLs

A comment was left on the first post in the series asking if I could show how to copy ACLs from one object to another.  For the sake of this post we’ll assume that the ACLs from c:\test will be … Continue reading

Posted in File system, Powershell | Leave a comment