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

  • SEARCH
  • Home
  • 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 543111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:31:02+00:00 2026-05-13T10:31:02+00:00

I am writing a program that will basically make a xml copy of most

  • 0

I am writing a program that will basically make a xml copy of most things in the local computer SAM store for users.

Currently it only prints a XMLElement for each user but it does not print the attributes for them.

<?xml version="1.0" encoding="utf-8"?>
<WindowsUserList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <windowsUserEntry />
  <windowsUserEntry />
  ...
  <windowsUserEntry />
  <windowsUserEntry />
</WindowsUserList>

This is my main code, the check box text has formatted name for a search as its text (accounting* for example to get users accounting1, 2, 3 ect..)

windowsUserList listUsers = new windowsUserList();
PrincipalContext context = new PrincipalContext(ContextType.Machine, Settings.Default.ipAddress, Settings.Default.username, Settings.Default.password);
foreach (CheckBox cbx in groupBox1.Controls.OfType<CheckBox>())
{
  if (cbx.Checked)
  {
    UserPrincipal usr = new UserPrincipal(context);
    if (cbx.Text == "")
    {
      usr.Name = txtCustom.Text;
    }
    else
    {
      usr.Name = cbx.Text;
    }
    PrincipalSearcher search = new PrincipalSearcher(usr);
    PrincipalSearchResult<Principal> results = search.FindAll();
    foreach (Principal result in results)
    {
      listUsers.AddUser(new windowsUserEntry((UserPrincipal)result));
    } // foreach (Principal result in results)
  }//if (cbx.Checked)
}//foreach (CheckBox cbx in groupBox1.Controls.OfType<CheckBox>())
XmlSerializer s = new XmlSerializer(typeof(windowsUserList));
TextWriter w = new StreamWriter(dlgSave.OpenFile());
s.Serialize(w, listUsers);
w.Close();

The code for windows user list/entry is very long so I posted it to pastebin

  • 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-05-13T10:31:02+00:00Added an answer on May 13, 2026 at 10:31 am

    The properties of your windowsUserEntry class are read-only. XML serialization can only serialize read-write properties

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

Sidebar

Related Questions

I'm writing a program in C# that will need to store a few Data
I'm writing a python program that will spawn a subprocess to basically clone a
I'm a student just learning xml and c#. I'm writing a program that will
I am contemplating writing a program that will move some newly created dirs to
I'm a writing a program that will determine the number of lines, characters, and
I'm writing a program that sends an array through a function (upperhess) that will
I'm writing a simple program that will run entirely client-side. (Desktop programming? do people
I am writing an HTML program that will be accessed by over 500 people
I am writing a program, for homework, that will add 2 8-bit binary numbers.
I'm writing a program that will have both a server side and a client

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.