Search This Blog

Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Monday, January 28, 2013

Get mailbox size exchange 2007

How to get mailbox size in exchange 2007 via PowerShell.
Very simple!
1. If you need to check mailbox size for individual use string bellow:

Get-MailboxStatistics username | ft DisplayName, TotalItemSize, ItemCount
******for more information use get-help Get-MailboxStatistics -full******

2. If you need to get mailbox size for all user use next command:

Get-MailboxStatistics | ft DisplayName, TotalItemSize, ItemCount
******To export output to the file, add > c:\mailboxsize.txt******

FOR EXAMPLE:  Get-MailboxStatistics | ft DisplayName, TotalItemSize, ItemCount > c:\mailboxsize.txt

To view more friendly output you can try to use my string:


Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression = {$_.TotalItemSize.Value.ToMB()}},ItemCount > c:\mailboxsize.txt


:)


******If the command is not working run this before:******

add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin

Sunday, January 20, 2013

From network drive Excel file takes long time to open (Office 2003)

Office 2003
The problem is with big excel files. When you try to open them from network drives, it takes long time to load.
For fix this issue you will be need to edit your REGISTRY.
Please follow these steps:

Please open StartRun →  and type regedit  <Enter>
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\FileValidation
****(If under Excel Key, Security and FileValidation does not exist, create it.)****
Right click on key "FileValidation" New → DWORD
Under Name of DWORD type EnableOnLoad  <Enter>
Right clcik on DWORD and choose Modify.
Set Value Data 0
Click <Ok> and exit from editor. Try Open again your EXCEL File.
Should be ok. :)




Tuesday, December 18, 2012

Active Directory | LDAP - DSQuery user






DSQuery user

Search for users in active directory.

Syntax
    DSQuery User [{StartNode | forestroot | domainroot}] [-o {dn | rdn | samid}] [-scope {subtree | onelevel | base}] [-name Name] [-desc Description] [-upn UPN] [-samid Filter] [-inactive NumberOfWeeks] [-stalepwd NumberOfDays] [-disabled] [{-s Server | -d Domain}] [-u UserName] [-p {Password | *}] [-q] [-r] [-gc] [-limit NumberOfObjects] [{-uc | -uco | -uci}]
Key
         StartNode | forestroot | domainroot The node in the console tree where the search starts. forestroot = search using the global catalog.

-o                               The format used to display the search results.
                                    dn = distinguished name.
                                    rdn = relative distinguished name.
                                    samid = Security Accounts Manager (SAM) account name.

-scope                     The scope of the search:
                                     subtree = subtree that is rooted at the start node in the console tree.
                                     onelevel = immediate children of the start node only.
                                     base = single object that the start node represents.
                                     If forestroot is the StartNode, then subtree is the only valid scope.

-name                        Search for user(s) whose name attribute(CN) matches Name.
                                     For example, "br*"

-desc                              Search for user(s) whose description matches. For example, "contractor*"

 -upn                                Users whose UPN attribute matches UPN

 -samid                           User(s) whose SAM account name matches SAMName

 -inactive                    Users who have been inactive for n number of weeks

-stalepwd                     Users who have not changed their passwords for n days

-disabled                    Users with disabled accounts

 -s                                     Server to connect to (Default=the domain controller in the logon domain.)

 -d                                     Domain to connect to.

 -u                                     Username with which the user logs on to a remote server.

 -p                                       Password (UserName or Domain\UserName or Username@domain.com)

 -q                                     Quiet, suppress all output

 -r                                     Recursive search (follow referrals)

 -gc                                    Use the AD global catalog during the search.

 -limit                             The maximum number of objects to return, default=100.

 -uc                                    Unicode format

 -uco                                Unicode format for output only

 -uci                                  Unicode format for input only

Examples

Find all inactive accounts (more than 4 weeks inactive)

C:\> dsquery user -inactive 4

Disable all inactive accounts (more than 4 weeks inactive)

C:\> dsquery user -inactive 4 | dsmod user -disabled yes

Export all active users to .txt file.

C:\> dsquery user -limit 1000 -o rdn -name * > c:\all_users.txt

Export all disabled users to .txt file.

C:\> dsquery user -limit 1000 -o rdn -disabled -name * > c:\all_disabled_users.txt

Tuesday, May 22, 2012

Windows Server 2008/2008 R2 Administrator's password reset.

How to reset administrator's password in windows server 2008?


Step 1
a) Insert DVD disk of Windows Server 2008
b) Boot from DVD disk
c) Navigate to "Repair your computer"

d) Choose first option ("Use recovery tools that can........")

e) Choose recovery tool:  "Command Prompt"

f) Enter commands like on screenshot below.

g) Click on "Restart"

Step 2
a) Click on utils button

b) Follow the screenshot below

c) Now you can login to server with Administrator withou any problems.

DON'T FORGET TO CHANGE UTILMAN.EXE BACK!!
Go to step 1. and open "Command Prompt"
Enter next commands to change back your utilman.exe
d:
cd windows/system32
move utilman.exe.bak utilman.exe

RESTART

eNj0Y!