DiskSpace Script not capturing all local disks - Help Please

Hello,
I am using a script to capture disk size for all local disks, however it is reporting incorrect disk sizes (example C drive reported as 30GB however it is actually50GB). It is also not reporting all local disks. Any help with below?
$erroractionpreference = “SilentlyContinue”
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$c.Cells.Item(1,1) = “Machine Name”
$c.Cells.Item(1,2) = “Drive”
$c.Cells.Item(1,3) = “Total size (GB)”
$c.Cells.Item(1,4) = “Free Space (GB)”
$c.Cells.Item(1,5) = “Free Space (%)”
$c.cells.item(1,6) = "Name "
$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True
$d.EntireColumn.AutoFit()
$intRow = 2
$colComputers = get-content "C:\Servers.txt"
foreach ($strComputer in $colComputers)
$colDisks = get-wmiobject Win32_LogicalDisk -computername $strComputer -Filter “DriveType = 3"
foreach ($objdisk in $colDisks)
$c.Cells.Item($intRow, 1) = $strComputer.ToUpper()
$c.Cells.Item($intRow, 2) = $objDisk.DeviceID
$c.Cells.Item($intRow, 3) = “{0:N0}” -f ($objDisk.Size/1GB)
$c.Cells.Item($intRow, 4) = “{0:N0}” -f ($objDisk.FreeSpace/1GB)
$c.Cells.Item($intRow, 5) = “{0:P0}” -f ([double]$objDisk.FreeSpace/[double]$objDisk.Size)
$c.cells.item($introw, 6) = $objdisk.volumename
$intRow = $intRow + 1
$d.EntireColumn.AutoFit()
cls

I've just tested your script as is, and it worked perfectly.
Are you sure those drives are regular?
Have you tried just printing the results in the console instead of Excel? there might be some setting there that changes what you see.
Also, have you considered the conversion between bytes and GB are misleading?

Similar Messages

  • "file not on the local disk" warning when it absolutely is

    Using DreamweaverCC2014 for the first time. Working on an older MacPro running Yosemite.
    I define a new site, specifying the directory in which my site's files are stored. The site has a single page, called index.htm, in the root directory, which has a link to a CSS stylesheet named "main.css" in a directory called "_css." The CSS file is contained within the directory, and appears in the Files tab of Dreamweaver as expected. The link to the stylesheet is properly formed on the index.htm page.
    At the top left of the workspace, I see two buttons: one for "Source Code," which, when selected, displays the source code for the page I am working on. Next to it is a button that says "main.css," which SHOULD allow me to open up the CSS page and edit it. However, when I click this button, I get a caution icon, along with the message that says:
    "'main.css' is not on the local disk."
    Next to this is a link that says "Get," which I would assume, when clicked, would allow me to find and relink the stylesheet. However, such is not the case. Instead, I get an alert window that says:
    "'main.css is not in a defined site"
    When I look at the page in Live View, the styled sheet is not shown, rather just the unstyled sheet. Looking at it in a browser, however, does.
    The code is correct; I have checked an re-checked it. The files are all in place and show up as expected in the Files panel. Any thoughts on why Dreamweaver thinks this CSS file doesn't exist?

    As this issue was diminishing my confidence in using the software for a mission-critical project, I contacted Adobe technical support for assistance.
    This is a known issue.
    The problem has to do with DW getting "confused" if there is any other file in the site root disk that may have the same name. In my case, there was (I tend to name the CSS files for my sites with the terribly generic "main" designation). The rep suggested that I create an entirely new site root, put my file structure into that, and see if the problem resolves. I did two things:
    First, I installed a completely new installation of DWCC2014 on my MacPro laptop. No existing site files of any kind on that machine. I then created a new site, using a copy of my original troublesome site's file structure. So, with the exception of the fact that this is on a machine that has no other sites or files, I am repeating the test using the exact same files and folder structure. When I click the Source Code button, I see the HTML source code. And when I click the CSS button...the CSS file displays as expected!
    Next experiment...back to my desktop MacPro. I copy the files for the site onto a completely different hard drive from the one I was using in my earlier failed attempt to get this to work. Again, same files and structure, only difference is the physical location of the files on a different hard drive. HTML source code displays, and, when the CSS button is clicked, the CSS page also displays as expected. Problem solved!
    So, I hope that my experience (and the solution) is helpful in the event others encounter this same issue. Again, this is a known issue at Adobe, so chances are good one of you out there will have this problem. The solution is to place your files in a completely new site root apart from any other that might have similar file names, so as not to "confuse" DW.

  • HT204053 My kids now each have an itouch, should we all have different apple ids even if I am paying for all itunes and app store purchases? what about icloud? I would like to share itunes and app purchases, but not necessarily photos...help please!

    My kids now each have an itouch, should we all have different apple ids even if I am paying for all itunes and app store purchases? what about icloud? I would like to share itunes and app purchases, but not necessarily photos...help please!

    The recommended solution for most families is to share the same Apple ID for iTunes and App Store purchases, so you can share your purchases, but us different IDs for iMessage, FaceTime and iCloud.  With this arrangement, each person can automatically download purchases made on the shared ID (by turning this feature on in Settings>iTunes & App Stores), while keeping their FaceTime calls, text messages and iCloud data (including photo stream) separated.  There is no requirement that the ID you use for purchasing be the same as the ID you use for these other services.
    This article: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/.

  • After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.

    After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ

    Izit software or hardware? Confuse:(
    Only can use wifi now.
    Any way thanks guys for ur suggestion:) amishcake and simes

  • After updating to latest iOS my iphone 4 is mute, at start the other party couldn't hear me, now I cant hear anything not even the ringing tone. This happens only if make regular  calls through my carrier. If use viber all ok. Help please?

    After updating to latest iOS my iphone 4 is mute, at start the other party couldn't hear me, now I cant hear anything not even the ringing tone. This happens only if make regular  calls through my carrier. If use viber all ok. Help please?

    I read on another discussion that sucking air out of the headphone slot works, I tried it and guess what, it worked.......weired....apparently something to do with moisture accumulation....!!!!!!

  • I had all photos on a Windows desktop.  Got a mac laptop, installed LR5, and put all images from Windows onto an external hard drive.  When I go to import them into LR on the Mac, they are all locked.  Help, please.  Thanks

    I had all photos on a Windows desktop.  Got a mac laptop, installed LR5, and put all images from Windows onto an external hard drive.  When I go to import them into LR on the mac, they are all locked.  Help, please!

    "I plugged the external into the Mac and moved a folder of images onto the desktop.  It looks like it went from read only to not locked.  Is this possible?"
    Yes, that's exactly what happened. If you buy another drive, you could copy from your existing drive to the new and your files will be read/write. The new drive will have to be formatted as an HFS drive (that's the Mac's format). If you need to format it, you use Disk Utility which is in the Utilities folder on your Mac. Be careful with that -- it wipes out whatever is currently on the drive. Make sure you format the right drive.
    I keep all my images on an external drive, too. In fact, I have two matching drives and sync them so I always have a backup.

  • Im trying to get some purchased songs to sync onto my ipad, but when i try it says they could not be synced as i need to authorise my computer which has been done already but its still not syncing them can someone help please?

    Im trying to get some purchased songs to sync onto my ipad, but when i try it says they could not be synced as i need to authorise my computer which has been done already but its still not syncing them can someone help please?

    Hello there, Gemss.
    The following Knowledge Base article offers up some great recommendations for the issue you're describing:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/TS1389
    Although all of the scenarios may be applicable, many folks find that the following section helps resolve their issue most often:
         Authorize using the correct account name
    The items you're trying to play might have been purchased using a different iTunes Store account. To determine which account was used to purchase an item, follow these steps:
    Select a purchased song in your library and choose File > Get Info.
    Click the Summary tab. Note the Account Name that appears in the list. This is the account name (Apple ID) you'll need to use when authorizing your computer to play this purchase.
    Note: The account name that appears is the one you used when purchasing the item and does not change if the account name (Apple ID) changes.
    If you've authorized the Apple ID that is shown in the Summary tab, you can check the purchase history for that Apple ID from Store > View My Account. If your purchase history does not reflect the purchase of the items in your iTunes library, consider any other Apple ID you may have created, and authorize the computer for your additional Apple ID.
    If you forgot the password to one of your accounts, you can recover it using Apple's password-recovery website.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • New iTunes on Mac doesn't allow me anymore to select all songs and 'Get info' to adjust the volume, like the old one. It says"your selection contains more than one type of media". They are all songs! Help please!

    New iTunes on Mac doesn't allow me anymore to select all songs and 'Get info' to adjust the volume, like the old one. It says"your selection contains more than one type of media". They are all songs! Help please!

    Raya Alfa wrote:
    ...there are some that are mp3 and it will be extremely hard to pick them from the lot.
    Not true. Select "Kind" as a sort category by right clicking the headings
    Then click to sort by Kind
    If your Import Settings are for Apple Lossless, AIFF, AAC or whatever the majority of your files are, convert MP3s to that file type.
    I've presently got 17,000+ files in my library, and they're ALL MP3 or M4B(Audiobooks). If they weren't when I got them, I converted them.  Saves a LOT of hassels with just this type of situation. Besides I have two non Apple MP3 players that WON'T work with other file types besides MP3 so, EVERYTHING I have has to be MP3.

  • HT1937 I have an iphone bought in the UK but I'm in Europe and can not use it I need help please help me thanks

    I have an iphone bought in the UK but I'm in Europe and can not use it I need help please help me thanks

    wiliiam rrichard wrote:
    Because My iphone is Locked on the United Kingdom
    No it is not.  iPhones, like all cell phones are not locked to countries.  They are locked to carriers.
    Only the carrier to whom the device is locked can unlock it.  Contact the carrier.

  • How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
    iWork > Pages
    contenant Templates > My Templates
    comme il y a un dossier
    iWork > Numbers
    contenant Templates > My Templates
    Depuis le Finder, tapez cmd + f
    puis configurez la recherche comme sur cette recopie d'écran.
    puis lancez la recherche.
    Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
    Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
    Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
    Désolé mais je ne répondrai plus avant demain.
    Pour moi il est temps de dormir.
    Yvan KOENIG (VALLAURIS, France)  mercredi 23 janvier 2011 22:39:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • I would like to upgrade my OS from 10.6.8. I can't find any higher version on the site. Yosemite is the latest but not available. Can someone help please?

    I would like to upgrade my OS from 10.6.8. I can't find any higher version on the site. Yosemite is the latest but not available. Can someone help please?

    If Yosemite is not available to you, your system may not meet the minimum requirements.
    How to install OS X Yosemite on your Mac - Apple Support

  • I have just downloaded Lion and my AverTv Molar will not work, just comes up can not find device can anybody help please

    Hi, I have just downloaded Lion, and my AverTV Volar M will not work, just come up can not find device can anybody help please.

    Contact the manufacturer's tech support for help. Most likely it needs a compatible driver.

  • I have purchased a TV show series. I show that from the purchased screen it has downloaded. However it is not in my library. How do I watch this episode? Several of the episodes are in the library but a few did not make it there. Help please!

    I have purchased a TV show series. I show that from the purchased screen it has downloaded. However it is not in my library. How do I watch this episode? Several of the episodes are in the library but a few did not make it there. Help please!

    Sometimes things have inconsistent labeling.  Check your Recently Added playlist.

  • Photoshop elements 11 install stops at sharing progs . Have tried all the trouble shoot info. All useless. Help Please

    Photoshop elements 11 install stops at sharing progs . Have tried all the trouble shoot info. All useless. Help Please
    Windows 8.1 OS

    Does everything include this:
    Troubleshoot installation | Photoshop Elements, Premiere Elements | Windows

  • Apple not recognizing known password.  Iforgot does not send email verification.  Help please.

    Apple not recognizing known password.  Iforgot does not send email verification.  Help please.
    Don't know any other way to put it.  I typed in the correct password.  Now the account is locked.  Iforgot does not send an email verification.  The email is not in the junk mail or anywhere else.  It is typed correctly.  This is frustrating.  I was just trying to update the Ipad Mini.  I wanted to change the ownership to my husband and noticed that my daughter attached a new Icloud account.  I was just trying to verify her account.  I have the correct password.  Now the account is locked out.

    I figured it out.  It's a little confusing.  I was trying to add a new email address for iCloud and I was supposed to type in the main iCloud user ID and password.  The wording is not helpful because it displays the name of the new email address.

Maybe you are looking for