Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8934409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:46:57+00:00 2026-06-15T09:46:57+00:00

The Follow script worked fine under win 7 with no issues, but when I

  • 0

The Follow script worked fine under win 7 with no issues, but when I loaded my app on windows 8 to see what all was broken I found that this script would no longer work correctly. Its a very simple script to load up user exchange Mailbox for searching if the user has a mailbox within a larger app. It’s actually written in python because I use IronPython as a plugin system.

    password = SecureString()
    str_password = "PASSWORD"
    str_user = "EXCHUSER"
    uri = "http://" + exchangeServerIP + "/PowerShell"

    for c in str_password:
        password.AppendChar(c)

    creds = PSCredential(str_user, password)

    connectionInfo = WSManConnectionInfo(Uri(uri), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", creds)

    connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic

    runspace = RunspaceFactory.CreateRunspace(connectionInfo)

    runspace.Open()

    powershell = PowerShell.Create()
    powershell.AddCommand("Get-Mailbox")
    if self.txtUsername.Text != "*":
        powershell.AddParameter("Identity", self.txtUsername.Text)

    powershell.AddParameter("ResultSize", "Unlimited")
    powershell.Runspace = runspace

    results = powershell.Invoke()

    if results == None or results.Count <= 0:
        MessageBox.Show("No mailboxes can be found!")
        runspace.Close()
        runspace.Dispose()
        powershell.Dispose()
        return

    self.dataGridView1.Rows.Clear()

    for result in results:
    >>>>>>> if result.Properties != None:   (ERROR HERE)  <<<<<<<
                if result.Properties["Name"] != None:
                    if result.Properties["Name"].Value != None:
                        System.Console.WriteLine(result.Properties["Name"].Value.ToString())

    runspace.Dispose()
    runspace.Close()
    runspace = None

    powershell.Dispose()
    powershell = None

    connectionInfo = None

I have marked where I get the error saying the result.Properties is NoneType which when debugging I can see that it is populated and the correct results are there. Not sure if windows 8 / .net 4.5 is the cause of the issue but works fine under win 7 exact code no null value. Any Suggestions would help greatly.

Updated (Answer):

After constant digging I finally found that the issue was with Powershell 3. Access the Members on using Powershell 2 with IronPython I could use result.Members[“Name”].Value but with Powershell 3 and the DLR, IronPython will return null value on result.Members Collection so I have to call it as result.Name. (Where result = PSObject)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:46:58+00:00Added an answer on June 15, 2026 at 9:46 am

    Let me know what error you are getting during compilation of ur above code.

    Also

    1.First check whether your code sdk version matches with your current software version.

    2.The code/app which are developed using visual studio 2008/09/10/11 wont work in visual studio 2012.

    3.If you copied the windows 7 app files to compile it in win8,it wont work.just create/code it from first in vs 2012.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I may have found a bug in PHP's crypt() function under Windows.
Why will my script not work correctly? I follow a YouTube video and worked
This has me stumped. The follow code returns ,,,,,,: <script type=text/javascript> $(function() { $('#listB').sortable({
EDIT: Answer found! Thank you very much people, a lot of answers worked, I
I have the follow script that uploads and image and a thumbnail to a
Hitting a page with the follow script displays: lat: undefined lon: 51.5001524 Why is
I have never worked on jquery but after some googling and learning I have
I'm trying to follow the guide here: http://docs.cloudfoundry.com/frameworks/ruby/rails-3-1.html And I have worked out many
I want run a script as follows: runner: ssh 'java program &' ssh 'java
I have a script that animates an element as follows: var item_height = $('#item').height();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.