Unsolved
1 Message
0
2047
Regex syntax for homedir creation
We have EMC Unity 300 and I have setup an file share with usage for home directories. What I did originally was just create one rule and it worked fine. Like most things, I should have thought this through. This became an issue as anyone who accessed a share on the same NAS was having a homedir created for them, and in some cases machine account names had homedir's created for them as well. Here is what my original rule was:
Domain | User | Path | Options |
* | * | \HomeDir | Auto-Create=yes, RegExp=no |
Here is what I would like to do, only create home directories for employees and not students or anything else. We already have logical separation of windows accounts, so seperating what should have a homedir created vs. what shouldn't is easy to define and translate into regex. Our students have ad accounts that seperate the first name and last name with a period (e.g. test.user or new.student). Our faculty and staff accounts are created with a first initial and lastname with sometimes containing a "-" (dash) or "_" (underscore), but never with a period. This led me to creating a regex that works in theory, but not when applied to the HomeDir database rules. Here is what the new rules with the regex look like (exact order as shown in the rules window pane):
Domain | User | Path | Options |
* | * | \no_home_dir | Auto-Create=no, RegExp=no |
.* | ^[a-zA-Z0-9_-]+$ | \HomeDir | Auto-Create=yes, RegExp=yes |
What I hoped would happen is that the regex would match any user without a period in the name and auto create a homedir in \\%NasName%\HomeDir, except it still creates homedir's for those with a period. I would have assumed if it didn't match the 1st rule it would go to the catchall. This rule has wildcards in both domain and user fields, but the path is non-existent and auto-create was turned off. What am I doing wrong here? Is the regex engine used by EMC different then others? Also, if I enable the reg. exp. checkbox in the rule, does that mean both the domain and user need to use regex or can a simple string match work for the domain while the user field contains a regular expression?
Rainer_EMC
8.6K Posts
0
February 19th, 2019 01:00
I would suggest to move the post to the Unity forum for better exposure
Celerra is only used for the old systems before VNX and Unity.