Question: how I can run this command in powershell to all users in the server?

```
powerShell -sta -file 'E:\Script-Popup\Popup-Message - Done.ps1'

```

that on every user who is currently connected to the server, this command will run.

Answer: 
The other answer does work. It also requires you to change your mapping every time the record or class changes their structure/constructors.

If you want to create the map once, and never touch it again even when your entities change, I can think of two alternatives:

1. Match the properties in your `record` with the nested class, like so:

```cs
// Include the word 'User' to reflect the nested AuthResult.User
public record AuthResponse(
    Guid UserId, 
    string UserUserName,
    string UserEmail,
    string Token);

// This makes the mapping extremely straightforward:
cfg.CreateMap<AuthResult, AuthResponse>();

```

2. Or, allow your `record` to be created with a 0-arg constructor (respecting the error you saw)

```
public record AuthResponse(
    Guid Id = default,
    string UserName = default!,
    string Email = default!,
    string Token = default!);

// This allows you to use the following
cfg.CreateMap<User, AuthResponse>();
cfg.CreateMap<AuthResult, AuthResponse>()
   .IncludeMember(src => src.User);
   /* If the above doesn't work, try instead: */
   //.AfterMap((src, dest, context) => context.Mapper.Map(src.User, dest));

```

The 2nd option will likely be *negligibly* less efficient.
I tried the following code, and it seems to work,

```
IConfigurationProvider configuration = new MapperConfiguration(cfg =>
            cfg.CreateMap<AuthResult, AuthResponse>()
               .ForCtorParam(ctorParamName: nameof(AuthResponse.Id), m => m.MapFrom(s => s.User.Id))
               .ForCtorParam(ctorParamName: nameof(AuthResponse.UserName), m => m.MapFrom(s => s.User.UserName))
               .ForCtorParam(ctorParamName: nameof(AuthResponse.Email), m => m.MapFrom(s => s.User.Email)));

var mapper = configuration.CreateMapper();

var result = mapper.Map<AuthResponse>(new AuthResult(new User { UserName = "Test", Email = "sas" }, "token"));

```