Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

new-object -com and Microsoft.Diskquota.1

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-17-2007   #1 (permalink)
Stephan Winkler
Guest


 

new-object -com and Microsoft.Diskquota.1

Hello,

i´m trying to work with quotas without success.


$disk = "D:\"
$quota = new-object -com "Microsoft.Diskquota.1"

$quota | gm
------------------------------------------------------------------------------------
Name MemberType Definition
---- ---------- ----------
_NewEnum Method IDispatch _NewEnum ()
AddUser Method DIDiskQuotaUser AddUser
(string)
DeleteUser Method void DeleteUser
(DIDiskQuotaUser)
FindUser Method DIDiskQuotaUser FindUser
(string)
GiveUserNameResolutionPriority Method void
GiveUserNameResolutionPriorit...
Initialize Method void Initialize (string,
bool)
InvalidateSidNameCache Method void InvalidateSidNameCache
()
ShutdownNameResolution Method void ShutdownNameResolution
()
TranslateLogonNameToSID Method string
TranslateLogonNameToSID (st...
DefaultQuotaLimit Property double DefaultQuotaLimit ()
{get} ...
DefaultQuotaLimitText Property string DefaultQuotaLimitText
() {g...
DefaultQuotaThreshold Property double DefaultQuotaThreshold
() {g...
DefaultQuotaThresholdText Property string
DefaultQuotaThresholdText (...
LogQuotaLimit Property bool LogQuotaLimit () {get}
{set}
LogQuotaThreshold Property bool LogQuotaThreshold ()
{get} {s...
QuotaFileIncomplete Property bool QuotaFileIncomplete ()
{get}
QuotaFileRebuilding Property bool QuotaFileRebuilding ()
{get}
QuotaState Property QuotaStateConstants
QuotaState () ...
UserNameResolution Property UserNameResolutionConstants
UserNa...

-------------------------------------------------------------------------------------

$quota.Initialize($disk,$true) < this fails with

Exception calling "Initialize" with "2" argument(s): "unknown
language. (Exception from HRESULT: 0x8002000C (DISP_E_UNKNOWNLCID))"


Bye,

Stephan


My System SpecsSystem Spec
Old 05-08-2007   #2 (permalink)
jar
Newbie


Join Date: May 2007
 
Rep Power: 11
jar is on a distinguished road
  jar is offline

Have you solved the problem with diskquota?
My System SpecsSystem Spec
Old 05-08-2007   #3 (permalink)
Don Jones [MVP]
Guest


 

Re: new-object -com and Microsoft.Diskquota.1

Has who solved it? What problem?

--
Don Jones
Windows PowerShell MVP
Founder: www.ScriptingAnswers.com
Co-Author: "Windows PowerShell: TFM"

"jar" <jar.2qabi4@no-mx.forums.net> wrote in message
news:jar.2qabi4@no-mx.forums.net...
>
> Have you solved the problem with diskquota?
>
>
> --
> jar


My System SpecsSystem Spec
Old 05-12-2007   #4 (permalink)
jar
Newbie


Join Date: May 2007
 
Rep Power: 11
jar is on a distinguished road
  jar is offline

The problem with instanciating the Microsoft.Diskquota.1 COM object. Try this:

$disk = "C:"
$quota = new-object -com "Microsoft.Diskquota.1"
$quota.Initialize($disk,$true)

Dosen't work and WMI is way to slow to enumerate the quota when you have 10000+ quotaobjects.
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Speech Object Library compiler warnings Kevin S Gallagher .NET General 0 05-21-2008 02:39 PM
Vista ASP.NET 2.0 Cannot open Excel File using Microsoft.Excel 12.0 COM object ckellywilson Microsoft Office 0 03-26-2008 02:04 PM
WM won't show OLE Object: Microsoft Office Excel Worksheet daissy Vista mail 12 11-19-2007 02:50 PM
"Microsoft.DiskQuota.1" Problems fickle.josh PowerShell 5 10-31-2007 08:55 AM
Adding canonical aliases for Compare-Object, Measure-Object, New-Object Alex K. Angelopoulos [MVP] PowerShell 2 05-26-2006 07:58 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51