Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 16 hours ago

Normalize Identifying Corporate Devices in Your Software

lgug2z.com

external-link
message-square
0
fedilink
2
external-link

Normalize Identifying Corporate Devices in Your Software

lgug2z.com

RSS BotMB to Lobste.rsEnglish · 16 hours ago
message-square
0
fedilink
If you dual-license your software in such a way that it requires a paid license for commercial use, here are two code blobs for you. macOS pub fn mdm_enrollment() -> eyre::Result<(bool, Option)> { let mut command = Command::new("/usr/bin/profiles"); command.args(["status", "-type", "enrollment"]); let stdout = command.output()?.stdout; let output = std::str::from_utf8(&stdout)?; if output.contains("MDM enrollment: No") { return Ok((false, None)); } let mut server = None; for line in output.lines() { if line.starts_with("MDM server") { server = Some(line.trim_start_matches("MDM server: ").to_string()) } } Ok((true, server)) } Windows pub fn mdm_enrollment() -> eyre::Result<(bool, Option)> { let mut command = Command::new("dsregcmd"); command.args(["/status"]); let stdout = command.output()?.stdout; let output = std::str::from_utf8(&stdout)?; if !output.contains("MdmUrl") { return Ok((false, None)); } let mut server = None; for line in output.lines() { if line.contains("MdmUrl") { let line = line.trim().to_string(); server = Some(line.trim_start_matches("MdmUrl : ").to_string()) } } Ok((true, server)) } Looking at mobile device management (MDM) enrollment is not a silver bullet for identifying corporate devices running your software, but it is a good start.

Comments

alert-triangle
You must log in or register to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 14 users / day
  • 83 users / week
  • 312 users / month
  • 1.29K users / 6 months
  • 2 local subscribers
  • 269 subscribers
  • 8.7K Posts
  • 442 Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org