FSRM - Get email address


hello,

 

i have ps script thats list quotas on file server cluster, need email address.

 

is possible using fsrm.fsrmquotamanager information?

 

my script:

$qm = new-object -com "fsrm.fsrmquotamanager"

$qm.enumquotas("e:\share23\*")

results:

id                    :
description           :
quotalimit            : 17179869184
quotaflags            : 256
thresholds            : {80, 100}
path                  : e:\share23\vpn
usersid               : s-1-0-0
useraccount           : null sid
sourcetemplatename    :
matchessourcetemplate : false
quotaused             : 8625235968
quotapeakusage        : 8627189760
quotapeakusagetime    : 28-07-2010 15:58:42

 

if dirquota, (dirquota quota list /list-notifications") have info need, need powershell because easier arranje info.

eesults dirquota (example):

quota path:             e:\share23\vpn
source template:        none
quota status:           enabled
limit:                  10,00 gb (hard)
used:                   302,56 mb (3%)
available:              9,70 gb
peak usage:             302,56 mb (05-08-2010 00:47)
thresholds:

notifications warning ( 80%):

   notification type:           e-mail
   run limit interval:          1440 minutes
   mail to:                     xpto@aaa.pt
   mail subject:                quota server notification [quota threshold]% no share xxxx
   mail from:                   mgrquota@aaa.pt
   message body:                neste momento está ocupar [quota used mb] mb de espaço no xxxx
quota passou os [quota threshold]% espaço total de [quota limit mb] mb.
caso ainda subsista alguma dúvida, por favor contacte o helpdesk

obrigado

notifications limit (100%):

   notification type:           e-mail
   run limit interval:          1440 minutes
   mail to:                     xpto@aaa.pt
   mail subject:                quota server notification [quota threshold]% no share xxxx
   mail from:                   xxxx

está utilizar [quota threshold]% espaço total de [quota limit mb] mb.
para desbloquear esta área e evitar futuros bloqueios, deverá remover ficheiros
que considere desnecessários.
caso ainda subsista alguma dúvida, por favor contacte o helpdesk
obrigado

 

so resuming :) possible email address (xpto@aaa.pt) using fsrm , powersheel? or have work dirquota ?

thanks,

 

ganhão

 

 

 

 

so, should work.
 
$quotainfo = dirquota
 
$addy = $quotainfo -match "mail to"
$useremail = $addy[0].substring($addy[0].lastindexof(" ") +1)
 
 
basically $quotainfo array of strings, results of dirquota
the -match find "mail to" string
then you'll find last space " " in string (emails cant have spaces) , substring next char forward email address.
 
 
justin


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Edit Group Policy

Hyper-V VM not reaching OS 'Logon' screen

DNS question...