Assistance with retrieving File and Version on a file with "custom file properties"

Morning,
I am attempting to get the file version and date info from a file on multiple workstations on our network. I already know the file location, name and even which workstations the file is on. What I cannot get the script to do is query them and return
the file version/date info. I need this so that I can identify which workstations require an update.
Here is what we have written so far, but it errors out with "there is not a "in" for the "for each" statement. The "in" is there so I am missing something else that I just cannot see. I need to feed the workstation names
to the script and get the results out put to a csv file.
$application = New-Object -ComObject excel.application 
$application.Visible = $false 
$document = $application.workbooks.open("C:\Program Files\Common Files\SAP Shared\BW\sapbex.xla") 
$binding = "System.Reflection.BindingFlags" -as [type] 
$customProperties = $document.CustomDocumentProperties 
foreach ($Property in $customProperties) 
 $pn = [System.__ComObject].InvokeMember("name",$binding::GetProperty,$null,$property,$null) 
  trap [system.exception] 
     write-host -foreground blue "Value not found for $pn" 
    continue 
  "$pn`: " + 
   [System.__ComObject].InvokeMember("value",$binding::GetProperty,$null,$property,$null)  
$application.quit()
Thanks in advance for your time and assistance.
T.S.



Morning,
I am attempting to get the file version and date info from a file on multiple workstations on our network. I already know the file location, name and even which workstations the file is on. What I cannot get the script to do is query them and return
the file version/date info. I need this so that I can identify which workstations require an update.
Here is what we have written so far, but it errors out with "there is not a "in" for the "for each" statement. The "in" is there so I am missing something else that I just cannot see. I need to feed the workstation names to the script and get the results
out put to a csv file.
$application = New-Object -ComObject excel.application 
$application.Visible = $false 
$document = $application.workbooks.open("C:\Program Files\Common Files\SAP Shared\BW\sapbex.xla") 
$binding = "System.Reflection.BindingFlags" -as [type] 
$customProperties = $document.CustomDocumentProperties 
foreach ($Property in $customProperties) 
 $pn = [System.__ComObject].InvokeMember("name",$binding::GetProperty,$null,$property,$null) 
  trap [system.exception] 
     write-host -foreground blue "Value not found for $pn" 
    continue 
  "$pn`: " + 
   [System.__ComObject].InvokeMember("value",$binding::GetProperty,$null,$property,$null)  
$application.quit()
Thanks in advance for your time and assistance.
T.S.
I can't easily replicate that here since I don't have an appropriate XLA file handy.  Two ideas.
1. Run a few lines and see what's in the CustomDocumentProperties member:
$application = New-Object -ComObject excel.application
$document = $application.workbooks.open("C:\Program Files\Common Files\SAP Shared\BW\sapbex.xla")
$document.CustomDocumentProperties
2. Change the foreach to a ForEach-Object by replacing "foreach ($Property in $customProperties) {" with "$document.CustomDocumentProperties | ForEach-Object {  $Property = $_ "

Similar Messages

  • Need Assistance With Custom Calculation Script

    I need help with a custom calculation script in Acrobat Pro.  I am trying to add the sum of fields A, B, C, D, E, F, and G together with the lesser value of fields H and I.  What would be the script to enter for this result?  Thank you.

    event.value = Number(this.getField("A").value) + Number(this.getField("B").value) + Number(this.getField("C").value) + Number(this.getField("D").value) + Number(this.getField("E").value) + Number(this.getField("F").value) + Number(this.getField("G").value) + Math.min(Number(this.getField("H").value), Number(this.getField("I").value));

  • Problems converting PDF to MS Word document.  I successfuly converted 4 files and now subsequent files generate a "conversion failure" error when attempting to convert the file.  I have a large manuscript and I separated each chapter to assist with the co

    Problems converting PDF to MS Word document.  I successfully converted 4 files and now subsequent files generate a "conversion failure" error when attempting to convert the file.  I have a large manuscript and I separated each chapter to assist with the conversion; like I said, first 4 parts no problem, then conversion failure.  I attempted to convert the entire document and same result.  I specifically purchased the export to Word feature.  Please assist.  I initially had to export the Word Perfect document into PDF and attempting to go from PDF to MS Word.

    Hi sdr2014,
    I'm sorry to hear your conversion process has stalled. It sounds as though the problem isn't specific to one file, as you've been unable to convert anything since the first four chapters converted successfully.
    So, let's try this:
    If you're converting via the ExportPDF website, please log out, clear the browser cache, and then log back in. If you're using Reader, please choose Help > Check for Updates to make sure that you have the most current version installed.
    Please let us know how it goes.
    Best,
    Sara

  • I have a windows 7 desktop with an external hard drive setup on my home network, will i be able to access this on my home network to save and retrieve files from my mac air?

    i have a windows 7 desktop with an external hard drive setup on my home network, will i be able to access this on my home network to save and retrieve files from my mac air?

    Troubleshooting Home Sharing - http://support.apple.com/kb/TS2972

  • "File with specified name and version number already exists. Result code= -48."   ...????

    Recently I have been getting this error message when I try to record an audio track in Logic... "File with specified name and version number already exists. Result code = -48."  WHAT IS THE PROBLEM?????? It's making me furious!

    Hi
    As the message says, there is a file at the recording directory that has the same name:
    http://support.apple.com/kb/ht1618
    Try changing the name of the track (this sets the filename in later versions of Logic 9
    CCT

  • I downloaded Adobe Acrobat XI Pro - I signed in and now all I get is the Adobe Download Assistant with a prompt to keep downloading the program or help page.

    I downloaded Adobe Acrobat XI Pro - I signed in and now all I get is the Adobe Download Assistant with a prompt to keep downloading the program or help page. How can I launch the actual program and not the Assistant?
    Under the download or application file I only have the Assistant program

    Moving this discussion to the Acrobat Installation & Update Issues forum.
    Isabellasf have you ran the installation files which were downloaded?  By default they are downloaded to the download folder within your User folder.

  • Download assistant with no products and can't login

    What is the download assistant using for username and password when it tries to sign in ?
    How can one change what it uses if it is in error ?

    Thanks Ned Murphy
    I would hope so.  But consistent error 100's with nothing but that is strange.   MS is likely stopping it.
    The tool just comes up and sits there.  When I press connect it comes back with an error code.  Nothing
    else.  No information of any kind that was useful.
    I had to remove it from my computer since it refused to do anything and I had it installed several times.
    The process has huge flaws in the business plan of Adobe. 
    I have been a long time buyer of your software and have 4 packages on this computer. 
    But something went wrong in a board meeting and loss of business reports have to take place now.
    I refuse to use a CLOUD only device.   I don't trust Clouds and have no reason to.  I'm also concerned that
    I could not just download a compressed file that would install.
    I'm 68, and former Very large company IT / Designer that kept the early days of you up and going.
    I had hoped to upgrade, but now I wonder why.
    You work for the 20 year old types and not for all of us.  You forget there are many retired people out there
    that buy software they have used for years.  Now it is made in a funny way that wards us off.
    The monthly bill is only good for senior citizens if there is an automatic break every year to re-up.  Then only
    a finite amount of money might be taken from a dead persons bank doing harm to the widow or child.
    Martin

  • Assistance with Regular Expression and Tcl

    Assistance with Regular Expression and Tcl
    Hello Everyone,
      I recently began learning Tcl to develop scripts for automating network switch deployments. 
    In my script, I want to name the device with a location and the last three octets of the base mac address.
    I can get the Base MAC address by : 
    show version | include Base
     Base ethernet MAC Address       : 00:00:00:DB:CE:00
    And I can get the last three octets of the MAC address using the following regular expression. 
    ([0-9a-f]{2}[:-]){2}([0-9a-f]{2}$)
    But I have not been able to figure out how to call the regular expression in the tcl script.
    I have checked several resources but have not been able to figure it out.  Suggestions?
    Ultimately, I want to set the last three octets to a variable (something like below) and then call the variable when I name the switch.
    set mac [exec "sh version | i Base"] (include the regular expression)
    ios_config "hostname location$mac"
    Thanks for any assistance in advance.
    Chris

    This worked for me.
    Switch_1(tcl)#set result [exec show ver | inc Base]   
    Base ethernet MAC Address       : 00:1B:D4:F8:B1:80
    Switch_1(tcl)#regexp {([0-9A-F:]{8}\r)} $result -> mac
    1
    Switch_1(tcl)#puts $mac                               
    F8:B1:80
    Switch_1(tcl)#ios_config "hostname location$mac"      
    %Warning! Hostname should contain at least one alphabet or '-' or '_' character
    locationF8:B1:80(tcl)#

  • If I use Migration Assistant to transfer files a second time from my iMac to my Macbook Pro, will I end up with doubles of files on my Macbook?

    I used Migration Assistant from my Time Machine for my iMac to my Macbook Pro (I'm pretty sure) when setting up my new laptop to transfer files I wanted from my desktop; now I have new files on my iMac that I'd like to transfer, and I'm wondering if Migration Assistant will send files that I already transferred to my Macbook again, thus creating doubles of files on my Macbook

    Welcome to Apple Support Communities
    Migration Assistant creates a new account to transfer files from another Mac, so you will end with doubles of files on the MacBook.
    To avoid this, you can go with the easier way: get an external drive, copy all the files you have on your iMac to the external drive, connect it to the MacBook and copy the files on the external drive to the folder you want to.
    Another way is to transfer them through your network. If you have OS X Lion or Mountain Lion on both Macs and they are connected to the same network, use AirDrop to transfer your files. Simply open a Finder window on the iMac and choose AirDrop in the sidebar. Then, drag the files you want to transfer to your MacBook Pro's icon.
    Finally, if you have FireWire in both Macs, you can use Target Disk mode on your iMac (hold the T key while your iMac is starting), so your MacBook Pro will detect your iMac's hard drive as an external drive and you will be able to transfer whatever you need

  • Whats is the easiest way to store and retrieve files using a DB?

    Hello,
    I have a web application where my users need to upload and retrieve files(.doc, .ppt. excel). I want to store them in the database instead of on the server. Anyone have any ideas on the easiest way to do this?
    Thanks,
    Danny

    Well, there's a BFILE data type-- that allows you to store essentially a pointer to a file in the database, though the file itself would be stored externally.
    A better option would be to store the data either as interMedia Text or as a B/CLOB, so all the data from the file would be stored in the file. interMedia Text gives a number of benefits if you're going to be working with the data-- i.e. searching the data, etc, but the additional work & restrictions may not be worth it if you just want to get the data in and out of the database whole.
    Justin

  • I'm using migration assistant to transfer files from my wife old net book to new mac air and the pc dropped out during transfer.  Pc now says waiting for mac to connect and has is stuck at transferring information.  How do I get the process to continue?

    I'm using migration assistant to transfer files from my wife old net book to new mac air and the pc dropped out during transfer. I started up migration assistant on the Pc again and now says waiting for mac to connect! New MacBook Air  is stuck at transferring information.  How do I get the process to reconnect and continue?

    Whew, good luck!
    What version of OSX is on the older one?

  • Assistance in retrieving hidden files on the desktop

    Good afternoon all,
    I'm actually assisting a family friend with her MacBook Pro. Apparently, one day she wanted to move multiple files on her desktop to one single folder. Should be easy enough, but unknowingly, she chose to "Select All" and moved all the files, even folders she did not wish to relocate, into one folder. Somehow, these files are now hidden in the desktop. For example, if I click anywhere on the desktop, where it looks as though no file is there, magically a file pops up. It's almost like a game at this point, clicking on random spots just to see what hidden file is there. I have never run into this sort of issue before, so any assistance with this matter would be greatly appreciated.

    I have asked the Hosts to move your post to the MacBook Pro Forum, you will get informed answers there.
    Good luck,

  • How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant.  The files show up on the new MacBook but cannot be opened.  Thanks!

    How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant?  The files show up on the new MacBook but cannot be opened.  Thanks!

    Get info then check permissions then add your curent user name (it was probably different on old Mac) and give your username full read/write permissions.

  • How can I access my parents iCloud account remotely to assist with photo management and printing?

    How can I access my parents iCloud account remotely to assist with photo management and printing?

    I tried that without any luck. I was hoping I could get Apple to reset it for me or delete the account so I could recreate it or at least tell me what is listed as my birth date, the security question answer.

  • Can I use my iPad with airport extreme to retrieve files from a USB connected hard drive?

    Can I use my iPad with airport extreme to retrieve files from a USB connected hard drive?

    Yes, I believe so. Please check out the NetPortal app. I don't have an iPad, but I use it on my iPod Touch to access files on my Time Capsule. It is available from the iTunes App Store.

  • Does auto-save and version work with old apps like pages '09?

    Hello,
    I'm new Lion user. I tried auto-save and version with textedit and it works.
    But i'm not sure it works with pages '09.

    It does work if you install the update from yesterday.

Maybe you are looking for