<PAGE>
                                                                               .
                                                                               .
                                                                               .
                                                                    EXHIBIT 10.5
[BIND VIEW LOGO]


                        RESTRICTED STOCK AGREEMENT (U.S.)


<Table>
<Caption>
<S>                     <C>
SHAREHOLDER NAME:       Shekar G. Ayyar

SHAREHOLDER             7188 Sharon Drive
ADDRESS:                San Jose, California  95129

NUMBER OF SHARES OF     50,000
RESTRICTED STOCK:

GRANT DATE:             July 19, 2004

PLAN:                   Omnibus Incentive Plan
</Table>


<Table>
<Caption>
                        VESTING SCHEDULE
            (FOUR-YEAR VESTING; SEE ALSO SECTION 2)

  EVENT                    DATE               NO. OF SHARES
                                                  VESTED
<S>                     <C>                   <C>
VESTING                 July 19, 2004         None
START DATE:

First Vesting Date      the date one year     one-fourth (1/4) of the full
                        after the Vesting     number of Shares
                        Start Date

Subsequent vesting      each three (3)        an additional one-sixteenth
dates                   months after the      (1/16) of the full number of
                        First Vesting Date    Shares, until vested as to 100%
                                              of the Shares
</Table>

    BindView Corporation ("BINDVIEW" or "US") hereby grants to the Shareholder
identified above ("YOU"), who is an employee of BindView or of an affiliate of
BindView, shares of restricted stock of BindView (the "SHARES"), as set forth
above. The grant of the restricted stock is subject to the terms and conditions
of this "AGREEMENT" and to the terms and conditions of the above "PLAN," as
amended by our Board of Directors ("BOARD") from time to time, which is
incorporated herein by reference, and a copy of which will be provided to you
upon request. All Section references are to sections of this Agreement except as
otherwise indicated. [BindView Corporation is a registered assumed name of
BindView Development Corporation.]

    1. Subject to Section 2 below, the Shares shall vest as provided in the
"VESTING SCHEDULE" above and in the Plan.

    2. (a) All capitalized terms not otherwise defined in this Agreement shall
have the respective meanings set forth in the Executive Employment Agreement
between you and BindView.

         (b) If you achieve your personal performance objectives, as defined in
paragraph (c) below, for each of the calendar years 2004 (partial year), 2005,
and 2006, then on July 19, 2007 the vesting of your restricted shares will be
accelerated so that they are 100% vested as of that date. Such acceleration of
vesting shall be in addition to payment of any Bonus Potential Earned to which
you are entitled for such achievement.

         (c) For purposes of paragraph (b), your personal performance objectives
for each of the referenced calendar years shall be those set by BindView, in its
sole discretion, in connection with the Corporate Bonus Plan approved by the
Compensation Committee for that year, the achievement of which objectives would
entitle you to a bonus payment equal to or greater than 100% of your Bonus
Potential At Target under such Plan.

         (d) No acceleration of vesting under paragraph (b) shall occur other
than expressly as set forth in that paragraph.

       3. All notices required or permitted under this Agreement must be in
writing and shall be effective upon receipt. Notices sent by certified mail, if
refused, shall be effective three business days after the date of mailing.
Notices to us shall be addressed to the attention of our vice president for
human resources at our then-current principal operating office. Notices to you
may be addressed to your home address as indicated in our then-current payroll
records.

       4. Nothing in this Agreement shall be deemed (i) to constitute an
employment contract, express or implied, nor (ii) to impose any obligation on us
or any of our affiliates to employ you at all or on any particular terms, nor
(iii) to amend any other agreement between you and us or any of our affiliates;
nor (iv) to impose any obligation on you to work for us or any of our
affiliates, nor (v) to limit the right of your employer to terminate your
employment for any reason, with or without cause, nor (vi) to limit your right
to resign from your employment.

Executed on the dates written below, to be effective as of the Grant Date.


BINDVIEW CORPORATION, BY:


------------------------------------------
Edward L. Pierce, Executive Vice President
and Chief Financial Officer


------------------------------------------
Date signed



The Shares have been accepted by the above-named Shareholder, subject to the
terms and provisions of the Plan and of this Agreement, by which the Shareholder
agrees to be bound


------------------------------------------
SHAREHOLDER SIGNATURE


------------------------------------------
Date signed