Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6910707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:50:57+00:00 2026-05-27T08:50:57+00:00

I am constructing a powershell script to query the existence of archived files within

  • 0

I am constructing a powershell script to query the existence of archived files within the folder that the files are archived to.

EMC’s disk extender moves the file from the live storage to archive storage and leaves a stub/link to the file.

You can still list the archive stub in the directory tree and the file still appears to be the same size but in reality it is an archive stub probably 1k in size.

The file attribute(s) of an archive stub give the value O

I need to query the files in the live folder where attribute of the file = O

then compare the list to my archive directory on another server outputting the files that do not exist on my archive where an archive stub exists on the live storage.

basically I need to know how to query the file attribute to retrieve O and do a compare.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:50:58+00:00Added an answer on May 27, 2026 at 8:50 am

    This function (taken from here) will return either true or false, depending on your O attribute

    function Get-FileAttribute{
    param($file,$attribute)
    $val = [System.IO.FileAttributes]$attribute;
    if((gci $file -force).Attributes -band $val -eq $val){$true;} else { $false; }
    } 
    
    Get-FileAttribute "C:\PST\T.dll" "Offline"
    

    You can use something like this:

    function Get-FileAttribute{
    param($file,$attribute)
    $val = [System.IO.FileAttributes]$attribute;
    if((gci $file -force).Attributes -band $val -eq $val){$true;} else { $false; }
    } 
    
    # Get items both from folder and from archive
    $folder = "C:\pst"
    $archive = "C:\pst"
    $itemsFromFolder = get-childitem $folder -recurse
    $itemsFromArchive = get-childitem $archive -recurse
    
    # Filter items from folder to have only offline files
    $offlineItemsFromFolder = New-Object 'System.Collections.Generic.List[System.IO.FileInfo]'
    foreach($item in $itemsFromFolder)
    {
    $isOffline = Get-FileAttribute $item.FullName  "Offline"
    if ($isOffline)
    {
        $offlineItemsFromFolder.Add($item)
    }
    }
    
    # Compare each offline item from folder with item from archive
    foreach($item in $offlineItemsFromFolder)
    {
        $result = $itemsFromArchive | Where-Object {$_.FullName -eq $item.FullName.Replace($folder, $archive)}
    # Do some processing depending on $result being $true or $false
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am constructing a query that will naturally return a result that has values
I'm constructing a hql query that needs to return orders where the User's ID
I am constructing a large HTML document from fragments supplied by users that have
I am currently constructing a Carputer front end and one function that it needs
We are constructing an application that will be interacting with Exchange 2007 calendar functions.
I'm constructing an area with selectable buttons that transition and appear every 10 frames.
I'm a PowerShell novice, and I'd love to be able to script this. I
I'm constructing a fluent interface where I have a base class that contains the
I'm having trouble constructing an efficient query in EF4 using type per table (TPT)
Constructing an OpenId provider, I've run into the curious problem that only Stack Exchange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.