30 settembre 2010

Exchange 2007 tricks

ottenere la lista delle public folder:
C:\Documents and Settings\sysadmin\Desktop>Get-PublicFolder \ -Recurse

Name                                                                               Parent Path
----                                                                                     -----------
IPM_SUBTREE
Calendario Condiviso Pippo                                              \
Contatti aziendali TOPOLINO                                          \
Contatti Gruppo Paperini                                                  \



ottenere i permessi su una data cartella pubblica:
C:\Documents and Settings\sysadmin\Desktop>Get-PublicFolderClientPermission -id '\Contatti aziendali TOPOLINO'

Identity                                     User                                 AccessRights
--------------                                    ---------                               -----------------------
\Contatti TOPOLINO                  Predefinito                                       {None}
\Contatti TOPOLINO                   example.local/disney/Users/ppape  {Owner}
\Contatti TOPOLINO                   example.local/disney/Users/ttopo   {Owner}
\Contatti TOPOLINO                   Anonimo                                     {CreateItems}

Concatenare ssh o ssh chain

ssh -t -L 8000:localhost:8000 jumpbox.example.com 'ssh -L 8000:splunk.inside.example.com:8000 splunk01'

Sapere se Windows 2003 è a 32 o a 64 bit

cmd -> sysdm.cpl -> se è a 64 bit è indicato, se no è a 32
oppure
cmd -> winmsd.exe -> dettagli tipo di processore -> x86 (32bit), EM64T o ia64 (64bit)

AD e utenti

una query per avere l'utenteldap
c:\ > dsquery user -name esempioUtente

giochini con le stampanti su windows

# Imposta stampante predefinita
cscript c:\WINDOWS\system32\prnmngr.vbs -p "RICOH Aficio MP C4500 PCL 6" -t
# Mostra lista stampanti
cscript c:\WINDOWS\system32\prnmngr.vbs -l | more
# help
cscript c:\WINDOWS\system32\prnmngr.vbs -?

28 settembre 2010

Avviare servizio windows da Command Line in remoto

Ecco come fare ad avviare un servizio su windows in remoto:
c:\ > sc \\NomePC start "wpkgservice"
Oppure usando psexec così:
c:\ > psexec \\NomePC "net start wpkgservice"