Tag Archives: Commandline

Developer: How to use Github for Windows users?


https://mva.microsoft.com/en-US/training-courses-embed/github-for-windows-users-16749/Video-Basic-Concepts-and-the-GitHub-Workflow-Part-1-KTNeW39wC_6006218965

If you’re a Developer who is curious about Git and GitHub, be sure to check out this GitHub training. Join experts Briana Swift and Jeremy Foster for a look at basic Git and GitHub concepts, and see why millions of Developers use the fast and flexible dev process fostered by GitHub.

Take a look at GitHub workflows in a browser, find out how to use GitHub Desktop, check out GitHub integrations with Visual Studio and Visual Studio Code, and learn about Git on the command line. Plus, explore advanced techniques using GitHub.

  • Basic Concepts and the GitHub Workflow: Get an introduction to the basic concepts and the GitHub workflow.
  • GitHub in the Browser: Learn how to conduct GitHub workflows in a browser.
  • GitHub Desktop: See how to use GitHub Desktop to manage repositories, branches, and changes.
  • GitHub Integrations with Visual Studio: Get an intro to GitHub integrations with Visual Studio.
  • GitHub on the Command Line: Explore how to use GitHub on the command line.
  • Beyond the Basics: Take a look at advanced techniques using GitHub.

Hope this helps Smile

MAPI Developer: How to get file properties for .MSG file using MrMAPI tool?


Based on my earlier article, recently I got the below request from MAPIDevil (MAPI developer). Adding the detailed request: 

MSG File

In general, you can do this same stuff with either MFCMAPI utility or ended up by creating customer MAPI application. For this specific scenario again I tried my hands with MrMAPI command-line utility – it’s very simple, you need to just pass on the Input “.MSG file" and Output “Output file”.

MSG File

Also you can store the file in .txt file as well – it will contain XML output for you.
MSG File

You can check the output in the given folder and the output file as well:

MSG File

Now I think MAPIDevil can make use of this; also you can also give a try using MrMAPI as well… Smile

Happy MAPI programming…!!

Calculating file size, free space of any given .PST file with MrMAPI utility


Earlier in my blog, i got the request from one of the MAPI developer to see is there any way we can calculate the file size, free space of any given .PST file. Also he pointed that he can access the PST file using Stephen’s MFCMAPI utility.

MFCMAPI Snapshot

For this activity, I used Stephen’s another tool called,  “MrMAPI” a command line utility. The best part of the tool is that MrMAPI exposes MFCMAPI’s best features (which I love a lot) from the command line and its pretty easy to use. You can download it from: http://mfcmapi.codeplex.com/releases/view/127629

So I used MrMAPI and I can get the file size, free space of the given .PST file (we achieved this, even without writing a single line of code for it Smile ).

MrMAPI Snapshot

Hope this helps.

Analyze Microsoft Office programs problems, issues using OffCAT 2.0


The Microsoft Office Configuration Analyzer Tool (OffCAT) 2.0 provides a quick and easy way to analyze Microsoft Office programs for known configurations that cause problems.  Now with latest OffCAT 2.0, it provides a detailed report of your installed Office programs. This report includes many parameters about your Office program configuration and highlights known problems found when OffCAT scans your computer. For any problems that are listed in the report, you are provided with a link to a public-facing article (usually a Microsoft Knowledge Base article) on the issue so you can read about possible fixes for the problem. If you are a Help Desk professional, you can also save the report to file so that the results can be viewed in the Office Configuration Analyzer Tool on another client where the tool is installed. The Office Configuration Analyzer Tool also includes a command-line version that can be used to collect an OffCAT scan without user intervention.

What you got with new OffCAT 2.0:
– New User Interface (UI)
– Improved Reading pane
– More detailed info about scans
– Real time detection & Crash

By downloading OffCAT.msi for OffCAT 2.0, you are hereby consenting to the installation of this program to analyze select Microsoft Office programs on your computer. You can download it from http://www.microsoft.com/en-us/download/details.aspx?id=36852

Install it at the machine which you want to troubleshoot:
OffCAT

On successful update, you can see:
OffCAT

Now you can select which specific Office suite you want to scan:

OffCAT

I selected Microsoft Outlook and let it scan of Outlook…
OffCAT

On successful scan you can see the detailed report, so that you can analyze it on your own…
OffCAT

Recommendation: If you want to investigate in-detail what’s in the report, then I would recommend you to refer Greg Mansius detailed post at http://blogs.technet.com/b/exchange/archive/2015/04/13/upgrade-to-office-configuration-analyzer-tool-offcat-version-2.aspx.

Update: Here is a short overview to start the OffCAT Tool you can try the following:

    1. To start the Office Configuration Analyzer Tool, click the Microsoft Office Configuration Analyzer Tool icon on the Start menu.
      Note, if you are using Windows 8, search for OffCAT on the Start Screen to launch OffCAT.
    2. After OffCAT is started, select the Office program (and possibly the version) to be scanned, and then click Scan.
      Note: Outlook must be running in order to perform a scan of Outlook.
    1. After the scan is finished, the report that OffCAT generated is automatically displayed and the list of detected issues is arranged by ‘Symptom’.
    2. Expand the symptom(s) in the list that most closely match(es) the problem(s) you are experiencing in the scanned Office program.
    3. Click on an issue under the symptom group to see additional information on the issue.
    4. Click the ‘Click here to see possible solutions to this issue’ link to open the article containing a resolution to the issue.
    5. Repeat the previous three steps for any other issues you would like to address.

Documentation:
Also have a look at OffCAT Readme document.

Happy debugging!!

Utility review: Calcheck – Outlook Calendar Checking tool


In this post, we will have a look at the Calendar Checking tool (Calcheck) for Outlook which is published recently by Randy. This program checks the Microsoft Outlook Calendar and items for problems or for potential problems. It’s is a command-line program that checks Outlook Calendars for problems. To use this tool, the Outlook calendar must reside on a Microsoft Exchange Server.

Note: The tool does not work with IMAP, with POP3, or with other non-Exchange mail servers.

The tool opens an Outlook profile, opens the Outlook Calendar, and then checks several things such as permissions, free/busy publishing, and auto booking. Then, the tool checks each item in the calendar folder for problems that can cause items to seem to be missing or that might otherwise cause problems in the Calendar.

It can be used with the following: Outlook 2003, 2007, 2010 and Exchange Server 2003, 2007, 2010.

To install this download:

1.Click the Download button on this page to download the file and save it to your computer.
2.Unzip the compressed file that you downloaded in a blank directory on your computer.
Instructions for how to use this tool:

After you install this download, open a Command Prompt window in the directory that contains the CalCheck.exe file. To obtain detailed instructions, type the calcheck /? command in the Command Prompt window, and then press Enter.

Calcheck - Usage

Usage:
Here is a list of command-line switches for CalCheck.exe:

CalCheck [-P <Profile name>] [-M <Mailbox name>] [-S <Server name>] [-O<path>] [-A] [-F] [-R] [-V] [-No]
CalCheck -?

-P Profile name (If this parameter is not specified, the tool prompts you for a profile)
-M Mailbox DN (If this parameter is specified, only process the mailbox that is specified)
-S Server name (Process the complete server unless a mailbox is specified)
-O Output path (path to place output files -default is the current directory)
-A All calendar items are output to CALCHECK.CSV
-F Create a CalCheck folder, and move flagged error items to the folder
-R Put a Report message that contains the CalCheck.log file in the Inbox
-V Verbose output to the Command Prompt window
-No To omit a calendar item test
The No parameter works with "org" to omit the “Attendee becomes Organizer” test and works with "dup" to omit duplicate item detection
-? Print this message

To remove this download:
To remove CalCheck, delete the directory where it is installed on the hard disk.

Download:
You can download the utility in two flavors – CalCheckX64, CalCheckX86. You can download it from http://www.microsoft.com/en-us/download/details.aspx?id=28786&WT.mc_id=rss_office_allproducts

What the utility does & what you will see in the report?

When you try the Calcheck.exe, the following Calendar-specific checks are performed and logged in the report:

  • Permissions on the Calendar
  • Delegates on the Calendar
  • Free/Busy publishing information
  • Direct Booking settings for the Mailbox or Calendar
  • Total number of items in the Calendar folder

The following item-level checks are performed and logged in the report:

  • No Organizer email address
  • No Sender email address
  • No dispidRecurring property (causes an item to not show in the Day/Week/Month view)
  • Time existence of the dispidApptStartWhole and dispidApptEndWhole properties
  • No Subject for meetings that occur in the the future or for recurring meetings (a warning is logged)
  • Message Class check (a warning is logged)
  • dispidApptRecur (recurrence blob) is checked for time on overall start and end times, not for exceptions
  • Check for Conflict items in the Calendar
  • Check for duplicate items, based on certain MAPI properties
  • Check if over 1250 recurring meetings (a warning is logged) and 1300 recurring meetings (an error is reported); 1300 is the limit
  • Check if you are an attendee and you became the Organizer of a meeting
  • Check meeting exception data to ensure it is the correct size

Note: If you have a problem with CalCheck – you can post information about it on http://calcheck.codeplex.com/workitem/list/basic

Later I will add couple of screenshots that I tried at my end. I recommend you to try this wonderful utility and make use of it!

Happy troubleshooting!!

Exchange Server 2007, 2010: How to query user mailboxes, its permissions using Exchange PowerShell?


In Exchange Server 2007/2010, you can use Exchange PowerShell cmdlets (especially using Get-Mailbox, Get-MailboxPermission, Get-ADPermission, Get-MailboxFolderPermission) to get a verity of info. I played with couple of the below in different scenarios and want to share the same with you – so that you can give a shot and make use of.

Scenario # 1: How to query permissions on a mailbox (testuser1)?
> Get-MailboxPermission test1

image

Scenario #2: How to query permissions of all the mailboxes on a particular server?
> Get-Mailbox –Server “ServerName” | Get-MailboxPermission

image

Scenario #3: How to query permissions of all the mailboxes?
> Get-Mailbox | Get-MailboxPermission
Note: This will get the list of all permissions (including SELF permissions and inherited permissions)

image

Scenario # 4: How to query permissions of all the mailboxes (filter out SELF and inherited permissions)?
> Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITYSELF" -and $_.IsInherited -eq $false}

Scenario #5: How to query mailbox permissions and Security permissions (only enumerate permissions that are not Inherited)?
> Get-Mailbox | Get-MailboxPermission | where {$_.IsInherited -eq $False}
Note: The above query will get you the “explicitly assigned permissions”

Scenario #6: How to query the explicitly assigned permissions (filter out SELF permissions)?
> Get-Mailbox | Get-MailboxPermission | where { ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITYSELF”) }

Scenario #7: How to query list of all mailboxes with Send-As permission assigned on them?
> Get-Mailbox | Get-ADPermission | where {($_.ExtendedRights -like “*Send-As*”)} | FT –Wrap
Note: This will get the list of mailboxes with Send-As permission assigned. Also you can notice that it shows Send-As permissions assigned to SELF on all mailboxes also.

Scenario #8: How to query list of all mailboxes with Send-As permission assigned on them (filter out SELF and inherited permissions as similar to Scenario #4)?
> Get-Mailbox | Get-ADPermission | where {($_.ExtendedRights -like “*Send-As*”) -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITYSELF”)} | FT –Wrap

Scenario #9: How to query the permissions of shared calendar in Exchange 2010?
> Get-MailboxFolderPermission –identity “mailboxaccount*:Calendar”
Note: If you just try Get-MailboxFolderPermission with identity with mailboxaccount won’t get you the above.

Scenario #10: How to query the users rights to a specific users mailbox?
> Get-MailboxPermission –identity “username” | fl user, accessrights

image

Scenario #11: How to query the permissions for every users mailbox?
> Get-MailboxPermission –identity * | fl user, identity, accessrights

image

Note:

+ Exporting the data:
At anypoint of time, if you want to export the above results to a CSV file, then you can use “Export-csv”. Say, let we try with one of the above scenario – try with scenario # 2:
> Get-Mailbox | Get-MailboxPermission | Export-csv C:permissions.csv

image

+ Automation using .Net Framework:
If you want to like to add Exchange management capabilities to your Microsoft .NET Framework–based applications then you can try the above by referring the following: http://msdn.microsoft.com/en-us/library/bb332449(v=exchg.80).aspx and http://msdn.microsoft.com/en-us/library/ff326159(v=exchg.140).aspx.

Happy PowerShelling and automation…!!

My View on Microsoft Office Binary File Format validator (beta) utility – Post # 1


What I tried? Sometime earlier i reviewed (tried) the new command-line utility Microsoft Office Binary File Format Validator (beta) – which helps to to validate binary file format files for the following files and applications: .doc files (Microsoft Word 97/2000/2003 and file formats supported by Microsoft Office Word 2007/2010), .xls files (Microsoft Excel 97/2000/2003 and file formats supported by Microsoft Office Excel 2007/2010) and .ppt files (Microsoft PowerPoint 97/2000/2003 and file formats supported by Microsoft Office PowerPoint2007/2010).

Interesting facts that I observed:
+ Utility runs without requiring an installation of Word, Excel or PowerPoint on the computer.
+ Utility is supported on any computer that is running Windows XP with Service Pack 2 (SP2) or later versions.
+ When you run Microsoft Office Binary File Format Validator Beta, it either validates the complete file or fails at the first point where the scanned file does not comply with the particular binary file format open specification.

Installation/Uninstall:
Installation/Uninstall is straight forward. You can download appropriate one for 32-bit or the 64-bit operating system. On successful installation, you can notice a shortcut Microsoft Office Binary File Format Validator Beta launcher to the Start menu in Microsoft Office Binary File Format Validator in All Programs. Also the uninstallation works great for me.

How to validate & what’s the outcome?

+ When a nonconformance issue is located in the scanned file, Microsoft Office Binary File Format Validator Beta writes out a detailed log file, in XML format, that helps you locate and debug the error.

+ Let we see how to the Successful validation works: I tried the following at command line to validate “sample1.doc”:
C:Program FilesMicrosoft OfficeBFFValidator>bffvalidator.exe “C:testSample1.doc”

I notice that the Command Prompt window message includes the location of the file that was scanned, the time stamp of when the scan was finished and the location of the log file.
PASSED at 07/12/11 10:14:19 Log at: C:testSample1.doc.bffvalidator.07-12-11_10-14-19.xml

I looked at the .xml file (log file), which contains the following information

<BFFValidation path="C:testSample1.doc" datetime="07/12/11 10:14:19" result="PASSED"> </BFFValidation>

Will continue the remaining in the next post about my further review on the same…

Troubleshooting Outlook : Command line switches for Outlook 2010


Outlook 2010 provides the command line switches for our handy troubleshooting.

image

You can use some of these switches that are recommended for solving problems.

If you do hit an unexpected issue and want to run one of these switches. During these times, these switches can also been used when you need to restore Outlook settings to the default settings. 

Let we try to use the switches in Windows 7 and Outlook 2010:

a) You can use either one of the 3 options:

1) Open the Run command via Start-> Run

2) Press the Windows Logo + R on your keyboard

3) Open the Start Menu and use the Search field to type in for the next step. (see the pic)

b) In the box you opened in option 1/2/3 and just type: outlook.exe

c) Press the spacebar once, and then type a forward slash mark (/) followed by the switch you want to use (see the list given below).

d) Let we take example using the command line CleanReminders switch. 
The command you type in the Open box should look like this:

outlook.exe /cleanreminders

e) To run the command, click OK.

List of command line switches for Outlook 2010:

Switch Description

/a

Creates an item with the specified file as an attachment.

Example: "C:Program FilesMicrosoft OfficeOffice11Outlook.exe" /a "C:My Documentslabels.doc"
Note: If no item type is specified, IPM.Note is assumed. Cannot be used with message classes that aren’t based on Outlook.

/altvba otmfilename

Opens the VBA program specified in otmfilename, rather than %appdata%MicrosoftOutlookVbaProject.OTM.

/c messageclass

Creates a new item of the specified message class (Outlook forms or any other valid MAPI form). Some of the related examples:

  • /c ipm.activity creates a Journal entry
  • /c ipm.appointment creates an appointment
  • /c ipm.contact creates a contact
  • /c ipm.note creates an e-mail message
  • /c ipm.stickynote creates a note
  • /c ipm.task creates a task

/checkclient

Prompts for the default manager of e-mail, news, and contacts.

/cleanclientrules

Starts Outlook and deletes client-based rules.

/cleandmrecords

Deletes the logging records saved when a manager or a delegate declines a meeting.

/cleanfinders

Removes Search Folders from the Microsoft Exchange server store.

/cleanfreebusy

Clears and regenerates free/busy information. This switch can only be used when you are able to connect to your Microsoft Exchange server.

/cleanprofile

Removes invalid profile keys and recreates default registry keys where applicable.

/cleanpst

Launches Outlook with a clean Personal Folders file (.pst).

/cleanreminders

Clears and regenerates reminders.

/cleanrules

Starts Outlook and deletes client- and server-based rules.

/cleanschedplus

Deletes all Schedule+ data (free/busy, permissions, and .cal file) from the server and enables the free/busy information from the Outlook Calendar to be used and viewed by all Schedule+ 1.0 users.

/cleanserverrules

Starts Outlook and deletes server-based rules.

/cleansniff

Deletes duplicate reminder messages.

/cleansubscriptions

Deletes the subscription messages and properties for subscription features.

/cleanviews

Restores default views. All custom views you created are lost.

/designer

Starts Outlook without figuring out if Outlook should be the default client in the first run.

/embedding

Opens the specified message file (.msg) as an OLE embedding. Also used without command-line parameters for standard OLE co-create.

/f msgfilename

Opens the specified message file (.msg) or Microsoft Office saved search (.oss).

/firstrun

Starts Outlook as if it were run for the first time.

/hol holfilename

Opens the specified .hol file.

/ical icsfilename

Opens the specified .ics file.

/importprf prffilename

Launches Outlook and opens/imports the defined MAPI profile (*.prf). If Outlook is already open, queues the profile to be imported on the next clean launch.

/l olkfilename

Opens the specified .olk file.

/launchtraininghelp assetid

Opens a Help window with the Help topic specified in assetid.

/m emailname

Provides a way for the user to add an e-mail name to the item. Only works in conjunction with the /c command-line parameter.

Example: Outlook.exe /c ipm.note /m emailname

/nocustomize

Starts Outlook without loading outcmd.dat (customized toolbars) and *.fav file.

/noextensions

Starts Outlook with extensions turned off, but listed in the Add-In Manager.

/nopollmail

Starts Outlook without checking mail at startup.

/nopreview

Starts Outlook with the Reading Pane off.

/p msgfilename

Prints the specified message (.msg). Does not work with HTML.

/profile profilename

Loads the specified profile. If your profile name contains a space, enclose the profile name in quotation marks (").

/profiles

Opens the Choose Profile dialog box regardless of the Options setting on the Tools menu.

/recycle

Starts Outlook using an existing Outlook window, if one exists. Used in combination with /explorer or /folder.

/resetfoldernames

Resets default folder names (such as Inbox or Sent Items) to default names in the current Office user interface language.

Note: If you first connect to your mailbox Outlook using a Russian user interface, the Russian default folder names cannot be renamed. To change the default folder names to another language such as Japanese or English, you can use this switch to reset the default folder names after changing the user interface language or installing a different language version of Outlook.

/resetfolders

Restores missing folders for the default delivery location.

/resetnavpane

Clears and regenerates the Navigation Pane for the current profile.

/rpcdiag

Opens Outlook and displays the remote procedure call (RPC) connection status dialog.

/s filename

Loads the specified shortcuts file (.fav).

/safe

Starts Outlook without extensions, Reading Pane, or toolbar customization.

/safe:1

Starts Outlook with the Reading Pane off.

/safe:2

Starts Outlook without checking mail at startup.

/safe:3

Starts Outlook with extensions turned off, but listed in the Add-In Manager.

/safe:4

Starts Outlook without loading Outcmd.dat (customized toolbars) and *.fav file.

/select foldername

Starts Outlook and opens the specified folder in a new window.
For example, to open Outlook and display the default calendar use: "c:Program FilesMicrosoft OfficeOffice11Outlook.exe" /select outlook:calendar

/sniff

Starts Outlook and forces a detection of new meeting requests in the Inbox, and then adds them to the calendar.

/t oftfilename

Opens the specified .oft file.

/v vcffilename

Opens the specified .vcf file.

/vcal vcsfilename

Opens the specified .vcs file.

/x xnkfilename

Opens the specified .xnk file.

Happy troubleshooting with Outlook 2010!!